{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/confighub/json-schema/confighub-change-order-schema.json",
  "title": "ChangeOrder",
  "description": "Defines a change's identity as it moves between Spaces.",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/confighub-openapi.json#/components/schemas/ChangeOrder",
  "required": [
    "Slug"
  ],
  "type": "object",
  "properties": {
    "AbortedReason": {
      "type": "string",
      "description": "AbortedReason says why the ChangeOrder was given up on. Setting it is what aborts one: a ChangeOrder with a reason is Aborted whatever its Links say.",
      "x-confighub-where": {
        "dataType": "string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "AdoptedEndTagID": {
      "type": "string",
      "description": "AdoptedEndTagID is the Tag whose marks were taken as the ChangeOrder's boundary, when it was created with one, and empty when the boundary was each Unit's head Revision.",
      "format": "uuid",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "uuid",
        "references": "Tag"
      },
      "x-go-type-skip-optional-pointer": true,
      "x-omitzero": true
    },
    "Annotations": {
      "type": "object",
      "additionalProperties": {
        "maxLength": 1024,
        "pattern": "^(.|\\n)*$",
        "type": "string"
      },
      "description": "An optional map of Annotation key/value pairs for tools to attach information to entities.",
      "x-confighub-where": {
        "dataType": "map[string]string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "ChangeOrderID": {
      "type": "string",
      "description": "ChangeOrderID uniquely identifies a change order within the system.",
      "format": "uuid",
      "x-confighub-where": {
        "dataType": "uuid"
      },
      "x-go-type-skip-optional-pointer": true,
      "x-omitzero": true
    },
    "ChangeWorkflow": {
      "allOf": [
        {
          "$ref": "#/$defs/ChangeWorkflowSpec"
        }
      ],
      "description": "ChangeWorkflow governs how this ChangeOrder is promoted: the ordered stages it moves through and the gates that have to pass before it enters one. It is a copy taken when the workflow was associated, not a reference, so editing the ChangeWorkflow afterwards cannot change the rules a rollout already started under. Empty is a ChangeOrder no workflow governs, which is promoted ungated.",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "JSON"
      }
    },
    "ChangeWorkflowID": {
      "type": "string",
      "description": "ChangeWorkflowID is the ChangeWorkflow this ChangeOrder is promoted under. It says which workflow the stored copy was taken from, and keeps saying so after that workflow has been edited or deleted, which is why it is not a foreign key.",
      "format": "uuid",
      "x-confighub-where": {
        "dataType": "uuid",
        "references": "ChangeWorkflow"
      }
    },
    "CreatedAt": {
      "type": "string",
      "description": "The timestamp when the entity was created in \"2023-01-01T12:00:00Z\" format.",
      "format": "date-time",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "time"
      },
      "x-go-type-skip-optional-pointer": true,
      "x-omitzero": true
    },
    "DeleteGates": {
      "type": "object",
      "additionalProperties": {
        "type": "boolean"
      },
      "description": "An optional set of gates that, if any is present, will block deletion.",
      "x-confighub-where": {
        "dataType": "map[string]bool"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "Description": {
      "type": "string",
      "description": "Description is a human-readable description of the change.",
      "x-confighub-where": {
        "dataType": "string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "DisplayName": {
      "type": "string",
      "description": "Friendly name for the entity.",
      "x-confighub-where": {
        "dataType": "string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "EndTagID": {
      "type": "string",
      "description": "EndTagID is the identifier of the set of Revisions that end the ChangeOrder. The ChangeOrder always mints this Tag itself; supplying one at creation adopts its marks as the boundary, and the supplied Tag is recorded as AdoptedEndTagID and never written to. Without one the boundary is each Unit's head Revision.",
      "format": "uuid",
      "x-confighub-where": {
        "dataType": "uuid",
        "references": "Tag",
        "expandable": true
      },
      "x-go-type-skip-optional-pointer": true,
      "x-omitzero": true
    },
    "EntityType": {
      "type": "string",
      "description": "The type of entity.",
      "readOnly": true,
      "x-go-type-skip-optional-pointer": true
    },
    "HiddenReason": {
      "maxLength": 64,
      "pattern": "^([A-Za-z0-9]([\\-_.A-Za-z0-9]*[A-Za-z0-9])?)?$",
      "type": "string",
      "description": "The reason the entity is hidden, if it is. A hidden entity is left out of List and Search results, and of what bulk operations act on, unless the include_hidden parameter names its reason or is *, or the where parameter names the entity by Slug or ID. ConfigHub/YAML Units are created hidden with the reason BackingUnit unless given another.",
      "x-confighub-where": {
        "dataType": "string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "InScopeSpaceIDs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/UUID"
      },
      "description": "InScopeSpaceIDs is where the ChangeOrder is headed: the Spaces it propagates into, recorded as a list rather than asked again on each read. When WhereSpace or SpaceFilterID is set, the server writes it from that selection, and a write naming a different list is refused; otherwise the client supplies it. Empty names a change without saying where it is headed, in which case the Spaces the ChangeOrder's Links reach when its scope is derived are recorded instead; an Invoke ChangeOrder has no Links to fall back on and requires a non-empty list. ResolvedSpaceIDs and ReleasedSpaceIDs are measured against it. Changing it re-derives what the ChangeOrder covers.",
      "x-confighub-where": {
        "dataType": "[]uuid",
        "references": "Space"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "InvocationID": {
      "type": "string",
      "description": "InvocationID is the Invocation an Invoke ChangeOrder runs. Required for that UpdateType and refused for the others. Naming it here is what makes every Space in scope receive the same update: the invoke API takes what it runs from the ChangeOrder. Immutable.",
      "format": "uuid",
      "x-confighub-where": {
        "dataType": "uuid",
        "references": "Invocation",
        "expandable": true
      }
    },
    "Labels": {
      "type": "object",
      "additionalProperties": {
        "maxLength": 128,
        "pattern": "^[\\-_@/#$%&~+=!?.,:;(){}\\[\\]<>|A-Za-z0-9](([\\-_@/#$%&~+=!?.,:;(){}\\[\\]<>|A-Za-z0-9]| )*[\\-_@/#$%&~+=!?.,:;(){}\\[\\]<>|A-Za-z0-9])?$",
        "type": "string"
      },
      "description": "An optional map of Label key/value pairs to specify identifying attributes of entities for the purpose of grouping and filtering them.",
      "x-confighub-where": {
        "dataType": "map[string]string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "OrganizationID": {
      "type": "string",
      "description": "Unique identifier for an organization.",
      "format": "uuid",
      "x-confighub-where": {
        "dataType": "uuid",
        "references": "Organization",
        "expandable": true
      },
      "x-go-type-skip-optional-pointer": true,
      "x-omitzero": true
    },
    "Parameters": {
      "type": "object",
      "additionalProperties": {},
      "description": "Parameters supplies values for the declared Parameters of a parameterized Invocation, keyed by parameter name, validated against the declaration the way ParameterizedInvocations are on a direct call. One set for the whole ChangeOrder, not one per Space. Immutable.",
      "x-confighub-where": {
        "dataType": "JSON"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "Permissions": {
      "allOf": [
        {
          "$ref": "#/$defs/Permissions"
        }
      ],
      "description": "Permissions to access this change order.",
      "x-confighub-where": {
        "dataType": "map[string]map[string]map[uuid]bool"
      }
    },
    "PriorRevisions": {
      "enum": [
        "Include",
        "Skip",
        "Error",
        "All"
      ],
      "type": "string",
      "description": "How the ChangeOrder marks the Units its change does not change, and the default PriorRevisions for its promotions. Include (the default), Skip and Error mark such a Unit at the Revision its followers have taken, or at its LastReleasedRevisionNum when that is later, or at its head if it has neither, so promoting the change does not move it; a promotion then merges a changed Unit's Revisions from before the change (Include), passes over them for good (Skip), or refuses (Error). All marks every such Unit at its head, so promoting the change brings every Unit up to the Space it takes from. Immutable: the ChangeOrder's own Space is marked when it is created.",
      "x-confighub-where": {
        "dataType": "string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "PromotionFailures": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ChangeOrderPromotionFailure"
      },
      "description": "PromotionFailures records each promotion that did not complete: who ran it, when, into which Stage, and each Space it failed or was blocked in, with the Space's error or reason and the error of each Unit and Link whose write failed. The most recent entries are kept. Set by the server. (readonly)",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "JSON"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "PromotionOverrides": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ChangeOrderPromotionOverride"
      },
      "description": "PromotionOverrides records each promotion forced into a Stage whose gates did not hold: who forced it, when, into which Stage and Spaces, why, and which gates failed. The most recent entries are kept. Set by the server. (readonly)",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "JSON"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "Promotions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ChangeOrderPromotion"
      },
      "description": "Promotions records each promotion that wrote the change into Spaces: who ran it, when, into which Stage, and which Spaces. A promotion entering several Stages records one entry per Stage. The most recent entries are kept. Set by the server. (readonly)",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "JSON"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "ReleasePriorRevisions": {
      "enum": [
        "Include",
        "Error"
      ],
      "type": "string",
      "description": "What a Release of the ChangeOrder does with a bundled Unit's Revisions from before the change: those after its LastReleasedRevisionNum, up to the one the start Tag marks. Include (the default) releases them; Error refuses the publish, naming them and the ChangeOrders they belong to. A publish's PriorRevisions overrides it.",
      "x-confighub-where": {
        "dataType": "string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "ReleaseTagID": {
      "type": "string",
      "description": "ReleaseTagID is the Tag a Release of the ChangeOrder is published at. It marks one Revision of each releasable Unit (ProviderType empty or OCI) in every Space the change is in: the Revision the end Tag marks, or the head where the Unit does not carry it. It follows Revisions the resolve processor makes after the promotion, and can be moved with a tag move, until a Release in the Space has been published at it. Empty on ChangeOrders created before it existed.",
      "format": "uuid",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "uuid",
        "references": "Tag",
        "expandable": true
      },
      "x-go-type-skip-optional-pointer": true,
      "x-omitzero": true
    },
    "ReleasedRestoredSpaceIDs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/UUID"
      },
      "description": "ReleasedRestoredSpaceIDs is where the undoing has been released: the Spaces in RestoredSpaceIDs whose Units are released at or past the Revision the restore Tag marks. Covering ReleasedSpaceIDs is what State reports as RestoreReleased. Derived when the ChangeOrder is read.",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "[]uuid"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "ReleasedSpaceIDs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/UUID"
      },
      "description": "ReleasedSpaceIDs is where the ChangeOrder has been released: the Spaces in scope whose Units in the Space's release are applied at or past the Revision the end Tag marks. A Space with no ReleaseTargetID is never here, since nothing releases it. Derived when the ChangeOrder is read.",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "[]uuid"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "Releases": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ChangeOrderRelease"
      },
      "description": "Releases names, for each Space in ReleasedSpaceIDs, the earliest published Release of the Space that carries the change, which is the Release the gates read. A Space whose Releases no longer carry the change, such as one whose Release was withdrawn, has no entry. Derived when the ChangeOrder is read.",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "JSON"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "ResolvedSpaceIDs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/UUID"
      },
      "description": "ResolvedSpaceIDs is where the ChangeOrder has been fully propagated to: the Spaces in scope whose Links of its UpdateType have all merged it, plus the Space it resides in. For an Invoke ChangeOrder it is the Spaces in scope where every Unit WhereUnit selects carries the end Tag, and its own Space counts only if it is one of them. Derived when the ChangeOrder is read.",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "[]uuid"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "RestoreTagID": {
      "type": "string",
      "description": "RestoreTagID is the Tag marking the Revisions that undid the ChangeOrder. The first restore mints it; every restore after that marks with the same Tag. Empty until something has been restored.",
      "format": "uuid",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "uuid",
        "references": "Tag",
        "expandable": true
      },
      "x-go-type-skip-optional-pointer": true,
      "x-omitzero": true
    },
    "RestoredSpaceIDs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/UUID"
      },
      "description": "RestoredSpaceIDs is where the ChangeOrder has been undone: the Spaces whose Units all carry the restore Tag. Derived when the ChangeOrder is read.",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "[]uuid"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "ReviewRequests": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ChangeOrderReviewRequest"
      },
      "description": "ReviewRequests records whose review the change is waiting for: for each, the stage whose Spaces are to be reviewed (empty for the change order's own Space), the User, and when and by whom the review was requested. A request is not cleared when the review is given; whether a reviewer has reviewed is read from their Attestations. A merge patch replaces the list whole. At most 256.",
      "x-confighub-where": {
        "dataType": "JSON"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "SkippedUnits": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "SkippedUnits names the Units of the ChangeOrder's Space that it carries no Revisions of, mapped to the reason as a code: NotFollowed (nothing follows the Unit by Links of the change order's UpdateType, and it was never cloned), FollowedByOtherLinks (it is followed downstream, but not by Links of that UpdateType), NotMarked (the end Tag marks no Revision of it), NoStartRevision (a Link to it has never merged or resolved, and it predates empty start Revisions), AlreadyTaken (the Spaces in scope have already taken it as far as the end, so it is marked, carrying no Revisions), or TakenPastEnd (the Spaces in scope have taken it past the end, so it is not marked). Written when the scope is derived.",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "map[uuid]string",
        "references": "Unit"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "Slug": {
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9]([\\-_.A-Za-z0-9]*[A-Za-z0-9])?$",
      "type": "string",
      "description": "Unique URL-safe identifier for the entity.",
      "x-confighub-where": {
        "dataType": "string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "SpaceFilterID": {
      "type": "string",
      "description": "SpaceFilterID references a Filter (with From=Space) selecting where the ChangeOrder is headed, ANDed with WhereSpace when both are set. While either is set, the server evaluates the selection into InScopeSpaceIDs.",
      "format": "uuid",
      "x-confighub-where": {
        "dataType": "uuid",
        "references": "Filter",
        "expandable": true
      }
    },
    "SpaceID": {
      "type": "string",
      "description": "Unique identifier for a space.",
      "format": "uuid",
      "x-confighub-where": {
        "dataType": "uuid",
        "references": "Space",
        "expandable": true
      },
      "x-go-type-skip-optional-pointer": true,
      "x-omitzero": true
    },
    "SpaceSlug": {
      "type": "string",
      "description": "Slug of the Space this entity belongs to. (readonly)",
      "readOnly": true,
      "x-go-type-skip-optional-pointer": true
    },
    "Stage": {
      "type": "string",
      "description": "Stage is the stage of ChangeWorkflow the change order has reached, or Completed once the last stage satisfies Final. Set by the server. (readonly)",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "StartTagID": {
      "type": "string",
      "description": "StartTagID is the identifier of the set of Revisions immediately before the ChangeOrder, making it the half-open interval (start, end].",
      "format": "uuid",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "uuid",
        "references": "Tag",
        "expandable": true
      },
      "x-go-type-skip-optional-pointer": true,
      "x-omitzero": true
    },
    "State": {
      "type": "string",
      "description": "State is how far the ChangeOrder has got: New until a Space other than its own has taken it, InProgress while some have and some have not, Resolved once every Space in scope has, Released once every Space in scope that has a ReleaseTargetID has released what it took (a Space with none has nothing to release), Aborted whenever AbortedReason is set, Restored once every Space that had taken it has been restored to the Revisions before it, and RestoreReleased once every Space that had released it has released the restored Revisions. Derived when the ChangeOrder is read.",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "UnitFilterID": {
      "type": "string",
      "description": "UnitFilterID references a Filter (with From=Unit) narrowing the same selection as WhereUnit, conjoined with it. Refused on the other UpdateTypes. Immutable.",
      "format": "uuid",
      "x-confighub-where": {
        "dataType": "uuid",
        "references": "Filter",
        "expandable": true
      }
    },
    "UpdateType": {
      "type": "string",
      "description": "UpdateType is how this ChangeOrder propagates. UpgradeUnit, the clone lineage, is the default, and MergeUnits is the other Link type it follows; both take the change from Revisions the source Unit already has. Invoke is the third: the change is one Invocation run in each Space in scope, and the ChangeOrder is created before any of it has happened. Insert, Upsert, and TransformPaths carry a change to Units outside the ChangeOrder's scope into the Spaces in scope: every Space in scope resolves its Links of that type to those Units at the Revision each was at when the ChangeOrder was created. Those Links must not be AutoUpdate, and InScopeSpaceIDs, or a selection that fills it in, is required.",
      "x-confighub-where": {
        "dataType": "string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "UpdatedAt": {
      "type": "string",
      "description": "The timestamp when the entity was last updated in \"2023-01-01T12:00:00Z\" format.",
      "format": "date-time",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "time"
      },
      "x-go-type-skip-optional-pointer": true,
      "x-omitzero": true
    },
    "UserID": {
      "type": "string",
      "description": "The User who created the ChangeOrder. Absent for ChangeOrders created before it was recorded. (readonly)",
      "format": "uuid",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "uuid",
        "references": "User"
      }
    },
    "Version": {
      "type": "integer",
      "description": "An entity-specific sequence number used for optimistic concurrency control. The value read must be sent in calls to Update.",
      "format": "int64",
      "readOnly": false,
      "x-go-type-skip-optional-pointer": true
    },
    "WhereSpace": {
      "type": "string",
      "description": "Filter expression selecting where the ChangeOrder is headed, ANDed with SpaceFilterID when both are set. While either is set, the server evaluates the selection into InScopeSpaceIDs when the ChangeOrder is created, when either field changes, and on an update or patch with refresh_spaces. The specified string is an expression for the purpose of filtering\nthe list of Spaces returned. The expression syntax was inspired by SQL.\nIt supports conjunctions using `AND` of relational expressions of the form *attribute*\n*operator* *attribute_or_literal*. The attribute names are case-sensitive and PascalCase,\nas in the JSON encoding.\nStrings support the following operators: `<`, `>`, `<=`, `>=`, `=`, `!=`, `LIKE`, `NOT LIKE`, `ILIKE`, `~~`, `!~~`, `~`, `~*`, `!~`, `!~*`, `IN`, `NOT IN`.\nString pattern operators: `LIKE` and `~~` for pattern matching with `%` and `_` wildcards,\n`ILIKE` for case-insensitive pattern matching, `NOT LIKE` and `!~~` for negated pattern matching.\nString regex operators: `~` for regex matching, `~*` for case-insensitive regex,\n`!~` and `!~*` for regex not matching (case-sensitive and insensitive).\nIntegers support the following operators: `<`, `>`, `<=`, `>=`, `=`, `!=`, `IN`, `NOT IN`.\nUUIDs and boolean attributes support equality and inequality only.\nUUID and time literals must be quoted as string literals.\nString literals are quoted with single quotes, such as `'string'`.\nTime literals use the same form as when serialized as JSON,\nsuch as: `CreatedAt > '2025-02-18T23:16:34'`.\nInteger and boolean literals are also supported for attributes of those types.\nArrays support the `?` operator to to match any element of the array,\nas in `FromLinkID ? '7c61626f-ddbe-41af-93f6-b69f4ab6d308'`.\nArrays can perform LEN() to check for length, as in `LEN(FromLinkID) > 0`.\nAn attribute naming a list of other entities can be filtered on their attributes with a `*` segment,\nas in `FromLink.*.Slug = 'upgrade-app'`, which holds when any element satisfies it.\nWithout the `*` such a reference is an error, since it names no single value to compare.\nMap support the dot notation to specify a particular map key, as in `Labels.tier = 'Backend'`.\nMaps support `IS NULL` and `IS NOT NULL` with dot notation to check for key absence or presence,\nas in `Labels.tier IS NULL` (key doesn't exist) or `Labels.tier IS NOT NULL` (key exists).\nComparison results can be tested with `IS TRUE`, `IS FALSE`, `IS NOT TRUE`, and `IS NOT FALSE`.\nThese are useful for nullable columns: `MergeSourceID = '<uuid>' IS NOT FALSE` matches rows where MergeSourceID equals the value OR is NULL.\nThe `IN` and `NOT IN` operators accept a comma-separated list of values in parentheses,\nsuch as `Slug IN ('slugone', 'slugtwo')` or `Labels.environment IN ('prod', 'staging')`.\nConjunctions are supported using the `AND` operator.\nAn example conjunction is:\n`CreatedAt >= '2025-01-07' AND Slug = 'test' AND Labels.mykey = 'myvalue'`.\n\nSupported attributes for filtering on Space: Annotations, AttributeFilterID, AttributeHash, AttributeIDs, BackingUnitID, ComponentID, CreatedAt, DeleteGates, DisplayName, HiddenReason, Labels, OCIRepositoryURL, OrganizationID, Permissions, ReleaseTargetID, Slug, SpaceID, TriggerFilterID, TriggerHash, TriggerIDs, UpdatedAt, UpstreamSpaceID.\n\nThe whole string must be query-encoded.",
      "x-confighub-where": {
        "dataType": "string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "WhereUnit": {
      "type": "string",
      "description": "WhereUnit narrows which Units of each Space in scope an Invoke ChangeOrder covers, and is refused on the other UpdateTypes. It takes what the where parameter of the Unit list does, attributes of what a Unit refers to included, as in `Space.Labels.Environment = 'prod'`. Empty covers every Unit. Unlike InScopeSpaceIDs it is asked again on every read, so a Unit added to a Space afterwards counts against that Space. Immutable.",
      "x-confighub-where": {
        "dataType": "string"
      },
      "x-go-type-skip-optional-pointer": true
    }
  },
  "$defs": {
    "ChangeOrderPromotion": {
      "type": "object",
      "properties": {
        "PromotedAt": {
          "type": "string",
          "format": "date-time",
          "x-go-type-skip-optional-pointer": true,
          "x-omitzero": true
        },
        "SpaceIDs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/UUID"
          },
          "x-go-type-skip-optional-pointer": true
        },
        "Stage": {
          "type": "string",
          "x-go-type-skip-optional-pointer": true
        },
        "UserID": {
          "type": "string",
          "format": "uuid",
          "x-go-type-skip-optional-pointer": true,
          "x-omitzero": true
        }
      }
    },
    "ChangeOrderPromotionFailure": {
      "type": "object",
      "properties": {
        "FailedAt": {
          "type": "string",
          "format": "date-time",
          "x-go-type-skip-optional-pointer": true,
          "x-omitzero": true
        },
        "Spaces": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ChangeOrderPromotionFailureSpace"
          },
          "x-go-type-skip-optional-pointer": true
        },
        "Stage": {
          "type": "string",
          "x-go-type-skip-optional-pointer": true
        },
        "UserID": {
          "type": "string",
          "format": "uuid",
          "x-go-type-skip-optional-pointer": true,
          "x-omitzero": true
        }
      }
    },
    "ChangeOrderPromotionFailureLink": {
      "type": "object",
      "properties": {
        "Error": {
          "type": "string",
          "x-go-type-skip-optional-pointer": true
        },
        "LinkID": {
          "type": "string",
          "format": "uuid"
        },
        "Slug": {
          "type": "string",
          "x-go-type-skip-optional-pointer": true
        }
      }
    },
    "ChangeOrderPromotionFailureSpace": {
      "type": "object",
      "properties": {
        "Action": {
          "type": "string",
          "x-go-type-skip-optional-pointer": true
        },
        "Error": {
          "type": "string",
          "x-go-type-skip-optional-pointer": true
        },
        "Links": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ChangeOrderPromotionFailureLink"
          },
          "x-go-type-skip-optional-pointer": true
        },
        "Message": {
          "type": "string",
          "x-go-type-skip-optional-pointer": true
        },
        "Reason": {
          "type": "string",
          "x-go-type-skip-optional-pointer": true
        },
        "SpaceID": {
          "type": "string",
          "format": "uuid",
          "x-go-type-skip-optional-pointer": true,
          "x-omitzero": true
        },
        "SpaceSlug": {
          "type": "string",
          "x-go-type-skip-optional-pointer": true
        },
        "Stage": {
          "type": "string",
          "x-go-type-skip-optional-pointer": true
        },
        "Units": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ChangeOrderPromotionFailureUnit"
          },
          "x-go-type-skip-optional-pointer": true
        }
      }
    },
    "ChangeOrderPromotionFailureUnit": {
      "type": "object",
      "properties": {
        "Error": {
          "type": "string",
          "x-go-type-skip-optional-pointer": true
        },
        "Slug": {
          "type": "string",
          "x-go-type-skip-optional-pointer": true
        },
        "UnitID": {
          "type": "string",
          "format": "uuid"
        }
      }
    },
    "ChangeOrderPromotionOverride": {
      "type": "object",
      "properties": {
        "FailedGates": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "x-go-type-skip-optional-pointer": true
        },
        "OverriddenAt": {
          "type": "string",
          "format": "date-time",
          "x-go-type-skip-optional-pointer": true,
          "x-omitzero": true
        },
        "Reason": {
          "type": "string",
          "x-go-type-skip-optional-pointer": true
        },
        "SpaceIDs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/UUID"
          },
          "x-go-type-skip-optional-pointer": true
        },
        "Stage": {
          "type": "string",
          "x-go-type-skip-optional-pointer": true
        },
        "UserID": {
          "type": "string",
          "format": "uuid",
          "x-go-type-skip-optional-pointer": true,
          "x-omitzero": true
        }
      }
    },
    "ChangeOrderRelease": {
      "type": "object",
      "properties": {
        "ReleaseID": {
          "type": "string",
          "description": "The earliest published Release of the Space that carries the change.",
          "format": "uuid",
          "x-go-type-skip-optional-pointer": true,
          "x-omitzero": true
        },
        "ReleaseNum": {
          "type": "integer",
          "description": "The Release's number within its Target.",
          "format": "int64",
          "x-go-type-skip-optional-pointer": true
        },
        "SpaceID": {
          "type": "string",
          "description": "The Space the Release was published from.",
          "format": "uuid",
          "x-go-type-skip-optional-pointer": true,
          "x-omitzero": true
        }
      }
    },
    "ChangeOrderReviewRequest": {
      "required": [
        "UserID"
      ],
      "type": "object",
      "properties": {
        "RequestedAt": {
          "type": "string",
          "description": "When the review was requested, by the server's clock. A new request is stamped with the current time, and an existing one keeps its time; sending a later time than the one recorded re-requests the review, and stamps it with the current time.",
          "format": "date-time",
          "x-go-type-skip-optional-pointer": true,
          "x-omitzero": true
        },
        "RequestedByUserID": {
          "type": "string",
          "description": "Who requested the review, or last re-requested it. Set by the server.",
          "format": "uuid",
          "readOnly": true,
          "x-go-type-skip-optional-pointer": true,
          "x-omitzero": true
        },
        "Stage": {
          "type": "string",
          "description": "The stage whose Spaces are to be reviewed, which is where an Attestation recorded with that TargetStage goes. Empty is the change order's own Space.",
          "x-go-type-skip-optional-pointer": true
        },
        "UserID": {
          "type": "string",
          "description": "The User asked to review.",
          "format": "uuid",
          "x-go-type-skip-optional-pointer": true,
          "x-omitzero": true
        }
      }
    },
    "ChangeWorkflowAttestationPrerequisite": {
      "required": [
        "Name"
      ],
      "type": "object",
      "properties": {
        "AllowAuthors": {
          "type": "boolean",
          "description": "Count an attester who wrote a Revision of the change. By default one does not count.",
          "x-go-type-skip-optional-pointer": true
        },
        "Count": {
          "type": "integer",
          "description": "How many distinct attesters must record a Pass on each Revision. 1 when zero.",
          "x-go-type-skip-optional-pointer": true
        },
        "Description": {
          "type": "string",
          "description": "What the requirement is for, in the author's words.",
          "x-go-type-skip-optional-pointer": true
        },
        "DistinctGroups": {
          "type": "boolean",
          "description": "Require an attester from each group of FromGroupIDs, which it requires. A user in several of the groups covers only one of them, and Count does not apply.",
          "x-go-type-skip-optional-pointer": true
        },
        "FromGroupIDs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/UUID"
          },
          "description": "The Groups whose members' Attestations count, beside the Users FromUserIDs names. Membership is read when the gate is evaluated, not when the Attestation was recorded.",
          "x-go-type-skip-optional-pointer": true
        },
        "FromUserIDs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/UUID"
          },
          "description": "The Users whose Attestations count. Empty is anyone who may record an Attestation in the Space.",
          "x-go-type-skip-optional-pointer": true
        },
        "IgnoreFail": {
          "type": "boolean",
          "description": "Count only passes. By default an unrevoked Fail from an eligible attester fails the requirement, however many passes there are.",
          "x-go-type-skip-optional-pointer": true
        },
        "MaxAge": {
          "type": "string",
          "description": "How old an Attestation may be and still count, as a duration such as 72h. No limit when empty.",
          "x-go-type-skip-optional-pointer": true
        },
        "Name": {
          "type": "string",
          "description": "What a stage, its ReleasePrerequisites, or Final gates on. Unique among the workflow's prerequisites, and refused if it shadows a built-in name.",
          "x-go-type-skip-optional-pointer": true
        },
        "Type": {
          "type": "string",
          "description": "The Attestation Type that counts. Approval when empty.",
          "x-go-type-skip-optional-pointer": true
        }
      }
    },
    "ChangeWorkflowFinalStage": {
      "type": "object",
      "properties": {
        "Prerequisites": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Evaluated over the last stage's Spaces, and named the same way a stage's entry gates are.",
          "x-go-type-skip-optional-pointer": true
        }
      }
    },
    "ChangeWorkflowPrerequisite": {
      "required": [
        "Name",
        "Expression"
      ],
      "type": "object",
      "properties": {
        "Description": {
          "type": "string",
          "description": "What the gate checks, in the author's words. A promotion this gate holds up reports the prerequisite by Name, so this is where the reason lives. Read by nobody: it is not part of what the gate evaluates.",
          "x-go-type-skip-optional-pointer": true
        },
        "Expression": {
          "type": "string",
          "description": "The check itself, carrying the \"cel:\" prefix. Evaluated against the Space under consideration, the change order being promoted, and that Space's Release; closing a ChangeSet binds Space and ChangeSet, with ChangeOrder and Release null. Compiled when the workflow is written.",
          "x-go-type-skip-optional-pointer": true
        },
        "Name": {
          "type": "string",
          "description": "What a stage or Final gates on. Unique within a workflow, and refused if it shadows a built-in name.",
          "x-go-type-skip-optional-pointer": true
        }
      }
    },
    "ChangeWorkflowSpec": {
      "type": "object",
      "properties": {
        "AttestationPrerequisites": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ChangeWorkflowAttestationPrerequisite"
          },
          "description": "The Attestations a stage, its releases, or Final may require. Declared once and named wherever they apply.",
          "x-go-type-skip-optional-pointer": true
        },
        "CustomPrerequisites": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ChangeWorkflowPrerequisite"
          },
          "description": "The checks a stage or Final may gate on beyond the built-in ones. Declared once and named wherever they apply.",
          "x-go-type-skip-optional-pointer": true
        },
        "Final": {
          "allOf": [
            {
              "$ref": "#/$defs/ChangeWorkflowFinalStage"
            }
          ],
          "description": "What the last stage must satisfy for the rollout to read as completed. Nothing is promoted into it: a stage's prerequisites gate entry to the stage after it, so the last stage's gate nothing. In a workflow with no stages, which governs a ChangeSet, what every Space the ChangeSet was opened in must satisfy for it to close."
        },
        "Stages": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ChangeWorkflowStage"
          },
          "description": "The stages a change is promoted through, in order. Ordered between stages and unordered within one. A workflow governing a ChangeOrder needs at least one; one governing a ChangeSet has none.",
          "x-go-type-skip-optional-pointer": true
        }
      }
    },
    "ChangeWorkflowStage": {
      "required": [
        "Name"
      ],
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "Identifies the stage within the workflow, and is what a promotion reports the change as having entered. Unique within a workflow.",
          "x-go-type-skip-optional-pointer": true
        },
        "Prerequisites": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The stage's entry gates, each naming a built-in check or one declared in CustomPrerequisites. Evaluated over every Space of the stage before this one; the first stage's are evaluated over the Space the ChangeOrder resides in, and refused for Invoke and fan-out ChangeOrders, whose change is in no Space before it is promoted.",
          "x-go-type-skip-optional-pointer": true
        },
        "ReleasePrerequisites": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Gates on publishing a Release for a change order in one of the stage's Spaces, each naming one declared in AttestationPrerequisites. Evaluated over the Revisions the Release bundles.",
          "x-go-type-skip-optional-pointer": true
        },
        "WhereSpace": {
          "type": "string",
          "description": "Selects the stage's Spaces: a where expression over Spaces, intersected with the change order's InScopeSpaceIDs. Nothing else is implied, so a workflow can be shared across components. Empty selects every Space in the change order's scope.",
          "x-go-type-skip-optional-pointer": true
        }
      }
    },
    "Permissions": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/Subjects"
      }
    },
    "Subjects": {
      "type": "object",
      "properties": {
        "GroupIDs": {
          "type": "object",
          "additionalProperties": {
            "type": "boolean"
          },
          "x-go-type-skip-optional-pointer": true
        },
        "UserIDs": {
          "type": "object",
          "additionalProperties": {
            "type": "boolean"
          },
          "x-go-type-skip-optional-pointer": true
        }
      }
    },
    "UUID": {
      "type": "string",
      "format": "uuid"
    }
  }
}