{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Proposed maintenance REST and local custody objects; NOT approved or mounted", "$defs": { "id": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$", "x-validation": "maintenanceguard.ValidID, including canonical last base64 bits" }, "digest": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, "v": { "const": 1 }, "time": { "type": "string", "format": "date-time", "maxLength": 35, "x-validation": "UTC RFC3339Nano; exact parse; server-generated except immutable client command timeout" }, "scope": { "type": "object", "additionalProperties": false, "required": [ "console_origin", "account", "app", "host" ], "properties": { "console_origin": { "type": "string", "minLength": 1, "maxLength": 253 }, "account": { "type": "string", "minLength": 1, "maxLength": 64 }, "app": { "type": "string", "minLength": 1, "maxLength": 64 }, "host": { "type": "string", "minLength": 1, "maxLength": 253 } } }, "reference": { "type": "object", "additionalProperties": false, "required": [ "id", "digest" ], "properties": { "id": { "$ref": "#/$defs/id" }, "digest": { "$ref": "#/$defs/digest" } } }, "recipient": { "type": "object", "additionalProperties": false, "required": [ "public_key", "fingerprint" ], "properties": { "public_key": { "type": "string", "minLength": 88, "maxLength": 88 }, "fingerprint": { "$ref": "#/$defs/digest" } } }, "config_source": { "type": "object", "additionalProperties": false, "required": [ "kind", "revision" ], "properties": { "kind": { "enum": [ "default", "named", "instance", "box-overlay" ] }, "revision": { "type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[!-~]+$", "not": { "pattern": "\\*" } } } }, "target": { "type": "object", "additionalProperties": false, "required": [ "version", "scope", "deployment_recipient", "record_identity", "record_revision", "artifact_version", "artifact_digest", "manifest_digest", "platform_version" ], "properties": { "version": { "$ref": "#/$defs/v" }, "scope": { "$ref": "#/$defs/scope" }, "deployment_recipient": { "$ref": "#/$defs/recipient" }, "record_identity": { "$ref": "#/$defs/digest" }, "record_revision": { "type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[!-~]+$", "not": { "pattern": "\\*" } }, "artifact_version": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[a-zA-Z0-9._-]{1,64}$", "not": { "enum": [ ".", ".." ] } }, "artifact_digest": { "$ref": "#/$defs/digest" }, "manifest_digest": { "$ref": "#/$defs/digest" }, "platform_version": { "type": "string", "minLength": 1, "maxLength": 64 } } }, "prepare": { "type": "object", "additionalProperties": false, "required": [ "version", "request_id", "attempt_id", "operation_label", "target", "result_recipient", "input_envelope", "input_envelope_digest", "timeout_seconds", "predecessor" ], "properties": { "version": { "$ref": "#/$defs/v" }, "request_id": { "$ref": "#/$defs/id" }, "attempt_id": { "$ref": "#/$defs/id" }, "operation_label": { "type": "string", "minLength": 1, "maxLength": 64 }, "target": { "$ref": "#/$defs/target" }, "result_recipient": { "$ref": "#/$defs/recipient" }, "input_envelope": { "type": "string", "maxLength": 98620, "minLength": 1 }, "input_envelope_digest": { "$ref": "#/$defs/digest" }, "timeout_seconds": { "type": "integer", "minimum": 1, "maximum": 600 }, "predecessor": { "anyOf": [ { "$ref": "#/$defs/reference" }, { "type": "null" } ] } } }, "prepared": { "type": "object", "additionalProperties": false, "required": [ "version", "request_id", "attempt_id", "request_digest", "state", "status_url", "review_url", "payload_expires_at", "lifecycle_operation_id" ], "properties": { "version": { "$ref": "#/$defs/v" }, "request_id": { "$ref": "#/$defs/id" }, "attempt_id": { "$ref": "#/$defs/id" }, "request_digest": { "$ref": "#/$defs/digest" }, "state": { "enum": [ "awaiting-preflight", "awaiting-approval" ] }, "status_url": { "type": "string", "minLength": 1, "maxLength": 1024 }, "review_url": { "type": "string", "minLength": 1, "maxLength": 1024 }, "payload_expires_at": { "$ref": "#/$defs/time" }, "lifecycle_operation_id": { "$ref": "#/$defs/id" } } }, "preflight": { "type": "object", "additionalProperties": false, "required": [ "version", "request", "attempt_id", "worker_assignment", "scope", "record_identity", "record_revision", "artifact_version", "artifact_digest", "manifest_digest", "input_envelope_digest", "result_recipient_fingerprint", "environment_envelope_digest", "config_sources", "worker_evidence", "expires_at", "lifecycle_operation_id", "execution_kind" ], "properties": { "version": { "$ref": "#/$defs/v" }, "request": { "$ref": "#/$defs/reference" }, "attempt_id": { "$ref": "#/$defs/id" }, "worker_assignment": { "$ref": "#/$defs/reference", "description": "Opaque server-internal immutable reference; encoding and authenticated producer validation remain unresolved worker-coordinator dependencies. CLI comparison is not provenance verification." }, "scope": { "$ref": "#/$defs/scope" }, "record_identity": { "$ref": "#/$defs/digest" }, "record_revision": { "type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[!-~]+$", "not": { "pattern": "\\*" } }, "artifact_version": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[a-zA-Z0-9._-]{1,64}$", "not": { "enum": [ ".", ".." ] } }, "artifact_digest": { "$ref": "#/$defs/digest" }, "manifest_digest": { "$ref": "#/$defs/digest" }, "input_envelope_digest": { "$ref": "#/$defs/digest" }, "result_recipient_fingerprint": { "$ref": "#/$defs/digest" }, "environment_envelope_digest": { "$ref": "#/$defs/digest" }, "config_sources": { "type": "array", "maxItems": 8, "items": { "$ref": "#/$defs/config_source" } }, "worker_evidence": { "$ref": "#/$defs/reference", "description": "Opaque server-internal immutable reference; encoding and authenticated producer validation remain unresolved worker-coordinator dependencies. CLI comparison is not provenance verification." }, "expires_at": { "$ref": "#/$defs/time" }, "lifecycle_operation_id": { "$ref": "#/$defs/id" }, "execution_kind": { "enum": [ "operation", "compatibility-check" ] } } }, "approval_form": { "type": "object", "additionalProperties": false, "required": [ "csrf", "request_id", "attempt_id", "candidate_digest", "candidate_revision" ], "properties": { "csrf": { "type": "string", "minLength": 1, "maxLength": 256 }, "request_id": { "$ref": "#/$defs/id" }, "attempt_id": { "$ref": "#/$defs/id" }, "candidate_digest": { "$ref": "#/$defs/digest" }, "candidate_revision": { "type": "string", "minLength": 1, "maxLength": 512 } } }, "status": { "type": "object", "additionalProperties": false, "required": [ "version", "scope", "request", "attempt_id", "revision", "state", "preflight", "approval", "outcome", "result_state", "result_envelope_digest", "payload_expires_at", "updated_at", "lifecycle_operation_id", "compatibility_outcome", "resume_ready_evidence" ], "properties": { "version": { "$ref": "#/$defs/v" }, "scope": { "$ref": "#/$defs/scope" }, "request": { "$ref": "#/$defs/reference" }, "attempt_id": { "$ref": "#/$defs/id" }, "revision": { "type": "string", "minLength": 1, "maxLength": 512 }, "state": { "enum": [ "awaiting-preflight", "awaiting-approval", "approved", "requested", "quiescing", "fenced", "executing", "succeeded", "failed", "ambiguous", "resume-requested", "resumed", "refused", "expired", "resume-ready" ] }, "preflight": { "anyOf": [ { "$ref": "#/$defs/reference" }, { "type": "null" } ] }, "approval": { "anyOf": [ { "$ref": "#/$defs/reference" }, { "type": "null" } ] }, "outcome": { "anyOf": [ { "$ref": "#/$defs/reference" }, { "type": "null" } ] }, "result_state": { "enum": [ "pending", "available", "unavailable", "expired" ] }, "result_envelope_digest": { "anyOf": [ { "$ref": "#/$defs/digest" }, { "type": "null" } ] }, "payload_expires_at": { "$ref": "#/$defs/time" }, "updated_at": { "$ref": "#/$defs/time" }, "lifecycle_operation_id": { "$ref": "#/$defs/id" }, "compatibility_outcome": { "anyOf": [ { "$ref": "#/$defs/reference" }, { "type": "null" } ] }, "resume_ready_evidence": { "anyOf": [ { "$ref": "#/$defs/reference" }, { "type": "null" } ], "description": "Opaque server-internal immutable reference; exact stored encoding and authenticated producer validation belong to future coordinator; CLI comparison is not provenance proof." } }, "allOf": [ { "if": { "properties": { "state": { "const": "resumed" } } }, "then": { "properties": { "outcome": { "$ref": "#/$defs/reference" }, "compatibility_outcome": { "$ref": "#/$defs/reference" }, "resume_ready_evidence": { "$ref": "#/$defs/reference" } } } }, { "if": { "properties": { "state": { "const": "resume-ready" } } }, "then": { "properties": { "outcome": { "type": "null" }, "compatibility_outcome": { "$ref": "#/$defs/reference" }, "resume_ready_evidence": { "$ref": "#/$defs/reference" }, "result_state": { "const": "pending" }, "result_envelope_digest": { "type": "null" } } } } ] }, "outcome": { "type": "object", "additionalProperties": false, "required": [ "version", "scope", "request", "attempt_id", "worker_assignment", "preflight", "approval", "record_identity", "record_revision", "artifact_digest", "environment_envelope_digest", "input_envelope_digest", "recipient_fingerprint", "guard_generation", "guard_digest", "state", "execution_evidence", "result_envelope_digest", "completed_at", "lifecycle_operation_id", "execution_kind", "compatibility_outcome", "resume_ready_evidence" ], "properties": { "version": { "$ref": "#/$defs/v" }, "scope": { "$ref": "#/$defs/scope" }, "request": { "$ref": "#/$defs/reference" }, "attempt_id": { "$ref": "#/$defs/id" }, "worker_assignment": { "$ref": "#/$defs/reference", "description": "Opaque server-internal immutable reference; encoding and authenticated producer validation remain unresolved worker-coordinator dependencies. CLI comparison is not provenance verification." }, "preflight": { "$ref": "#/$defs/reference" }, "approval": { "$ref": "#/$defs/reference" }, "record_identity": { "$ref": "#/$defs/digest" }, "record_revision": { "type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[!-~]+$", "not": { "pattern": "\\*" } }, "artifact_digest": { "$ref": "#/$defs/digest" }, "environment_envelope_digest": { "$ref": "#/$defs/digest" }, "input_envelope_digest": { "$ref": "#/$defs/digest" }, "recipient_fingerprint": { "$ref": "#/$defs/digest" }, "guard_generation": { "type": "integer", "minimum": 1, "maximum": 9223372036854775807 }, "guard_digest": { "$ref": "#/$defs/digest" }, "state": { "enum": [ "succeeded", "failed", "ambiguous", "resumed", "compatibility-checked" ] }, "execution_evidence": { "$ref": "#/$defs/reference", "description": "Opaque server-internal immutable reference; encoding and authenticated producer validation remain unresolved worker-coordinator dependencies. CLI comparison is not provenance verification." }, "result_envelope_digest": { "anyOf": [ { "$ref": "#/$defs/digest" }, { "type": "null" } ] }, "completed_at": { "$ref": "#/$defs/time" }, "lifecycle_operation_id": { "$ref": "#/$defs/id" }, "execution_kind": { "enum": [ "operation", "compatibility-check", "resume" ] }, "compatibility_outcome": { "anyOf": [ { "$ref": "#/$defs/reference" }, { "type": "null" } ] }, "resume_ready_evidence": { "anyOf": [ { "$ref": "#/$defs/reference" }, { "type": "null" } ], "description": "Opaque server-internal immutable reference; exact stored encoding and authenticated producer validation belong to future coordinator; CLI comparison is not provenance proof." } }, "allOf": [ { "if": { "properties": { "state": { "const": "resumed" } } }, "then": { "properties": { "execution_kind": { "const": "resume" }, "compatibility_outcome": { "$ref": "#/$defs/reference" }, "resume_ready_evidence": { "$ref": "#/$defs/reference" }, "result_envelope_digest": { "$ref": "#/$defs/digest" } } } }, { "if": { "properties": { "state": { "const": "compatibility-checked" } } }, "then": { "properties": { "execution_kind": { "const": "compatibility-check" }, "compatibility_outcome": { "type": "null" }, "resume_ready_evidence": { "type": "null" }, "result_envelope_digest": { "$ref": "#/$defs/digest" } } } }, { "if": { "properties": { "execution_kind": { "const": "operation" } } }, "then": { "properties": { "compatibility_outcome": { "type": "null" }, "resume_ready_evidence": { "type": "null" }, "state": { "enum": [ "succeeded", "failed", "ambiguous" ] } } } } ] }, "result": { "type": "object", "additionalProperties": false, "required": [ "version", "outcome", "outcome_reference", "result_envelope" ], "properties": { "version": { "$ref": "#/$defs/v" }, "outcome": { "$ref": "#/$defs/outcome" }, "outcome_reference": { "$ref": "#/$defs/reference" }, "result_envelope": { "type": "string", "maxLength": 87512, "minLength": 1 } } }, "resume": { "type": "object", "additionalProperties": false, "required": [ "version", "request_id", "attempt_id", "predecessor", "expected_status_revision", "target", "required_contracts", "result_recipient", "checker_input_envelope", "checker_input_envelope_digest", "timeout_seconds" ], "properties": { "version": { "$ref": "#/$defs/v" }, "request_id": { "$ref": "#/$defs/id" }, "attempt_id": { "$ref": "#/$defs/id" }, "predecessor": { "$ref": "#/$defs/reference" }, "expected_status_revision": { "type": "string", "minLength": 1, "maxLength": 512 }, "target": { "$ref": "#/$defs/target" }, "required_contracts": { "type": "array", "maxItems": 16, "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[a-z][a-z0-9]*([.-][a-z0-9]+)*$" }, "minItems": 1, "uniqueItems": true, "x-validation": "maintenanceguard.ValidContracts; strict ascending byte order and superset of retained contracts before approval/spawn." }, "result_recipient": { "$ref": "#/$defs/recipient" }, "checker_input_envelope": { "type": "string", "minLength": 1, "maxLength": 98620 }, "checker_input_envelope_digest": { "$ref": "#/$defs/digest" }, "timeout_seconds": { "type": "integer", "minimum": 1, "maximum": 600 } } }, "resume_proposed": { "type": "object", "additionalProperties": false, "required": [ "version", "request", "attempt_id", "lifecycle_operation_id", "state", "review_url", "status_url" ], "properties": { "version": { "$ref": "#/$defs/v" }, "request": { "$ref": "#/$defs/reference" }, "attempt_id": { "$ref": "#/$defs/id" }, "lifecycle_operation_id": { "$ref": "#/$defs/id" }, "state": { "enum": [ "awaiting-preflight", "awaiting-approval" ] }, "review_url": { "type": "string", "minLength": 1, "maxLength": 1024 }, "status_url": { "type": "string", "minLength": 1, "maxLength": 1024 } } }, "error": { "type": "object", "additionalProperties": false, "required": [ "version", "code" ], "properties": { "version": { "$ref": "#/$defs/v" }, "code": { "enum": [ "invalid-request", "not-signed-in", "not-found", "conflict", "precondition-failed", "payload-expired", "result-unavailable", "unsupported", "rate-limited", "unavailable" ] } } }, "pending_local": { "type": "object", "additionalProperties": false, "required": [ "version", "scope", "request_id", "attempt_id", "recipient_private_key", "recipient_fingerprint", "private_input_path", "private_input_sha256", "exact_request_body_base64", "request_kind" ], "properties": { "version": { "$ref": "#/$defs/v" }, "scope": { "$ref": "#/$defs/scope" }, "request_id": { "$ref": "#/$defs/id" }, "attempt_id": { "$ref": "#/$defs/id" }, "recipient_private_key": { "type": "string", "minLength": 44, "maxLength": 44 }, "recipient_fingerprint": { "$ref": "#/$defs/digest" }, "private_input_path": { "type": "string", "minLength": 1, "maxLength": 4096 }, "private_input_sha256": { "$ref": "#/$defs/digest" }, "exact_request_body_base64": { "type": "string", "minLength": 1, "maxLength": 174764 }, "request_kind": { "enum": [ "operation", "retry", "resume" ] } } }, "environment_private": { "type": "object", "additionalProperties": false, "required": [ "version", "entries", "box_overlay_identity" ], "properties": { "version": { "$ref": "#/$defs/v" }, "entries": { "type": "array", "maxItems": 512, "items": { "type": "object", "additionalProperties": false, "required": [ "name", "value" ], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 256 }, "value": { "type": "string", "maxLength": 65536 } } } }, "box_overlay_identity": { "type": "string", "minLength": 1, "maxLength": 512 } } }, "preflight_publication": { "type": "object", "additionalProperties": false, "required": [ "version", "publication_id", "preflight", "environment_envelope" ], "properties": { "version": { "$ref": "#/$defs/v" }, "publication_id": { "$ref": "#/$defs/id" }, "preflight": { "$ref": "#/$defs/preflight" }, "environment_envelope": { "type": "string", "minLength": 1, "maxLength": 1398232 } } }, "outcome_publication": { "type": "object", "additionalProperties": false, "required": [ "version", "publication_id", "outcome", "result_envelope" ], "properties": { "version": { "$ref": "#/$defs/v" }, "publication_id": { "$ref": "#/$defs/id" }, "outcome": { "$ref": "#/$defs/outcome" }, "result_envelope": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 87512 }, { "type": "null" } ] } } }, "retry": { "type": "object", "additionalProperties": false, "required": [ "version", "request_id", "attempt_id", "operation_label", "target", "result_recipient", "input_envelope", "input_envelope_digest", "timeout_seconds", "predecessor" ], "properties": { "version": { "$ref": "#/$defs/v" }, "request_id": { "$ref": "#/$defs/id" }, "attempt_id": { "$ref": "#/$defs/id" }, "operation_label": { "type": "string", "minLength": 1, "maxLength": 64 }, "target": { "$ref": "#/$defs/target" }, "result_recipient": { "$ref": "#/$defs/recipient" }, "input_envelope": { "type": "string", "maxLength": 98620, "minLength": 1 }, "input_envelope_digest": { "$ref": "#/$defs/digest" }, "timeout_seconds": { "type": "integer", "minimum": 1, "maximum": 600 }, "predecessor": { "$ref": "#/$defs/reference" } }, "description": "Same prepare fields; predecessor is required non-null and its ID must equal the route request_id. Digest binds predecessor request bytes; server resolves its outcome." } } }