{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Spacelift Policy Contract",
  "description": "Complete schema defining all Spacelift policy types, their input data structures, and expected rule outputs",
  "policyTypes": {
    "ACCESS": {
      "description": "Access policies control whether users can access specific stacks.",
      "input": {
        "allOf": [
          {
            "properties": {
              "request": {
                "$ref": "#/$defs/request",
                "description": "Details about the access request"
              }
            },
            "required": ["request"],
            "type": "object"
          },
          {
            "oneOf": [
              {
                "properties": {
                  "session": {
                    "$ref": "#/$defs/session",
                    "description": "Session information for the user requesting access"
                  }
                },
                "required": ["session"],
                "type": "object"
              },
              {
                "properties": {
                  "slack": {
                    "$ref": "#/$defs/slack",
                    "description": "Slack access information"
                  }
                },
                "required": ["slack"],
                "type": "object"
              }
            ]
          },
          {
            "oneOf": [
              {
                "properties": {
                  "stack": {
                    "$ref": "#/$defs/stack",
                    "description": "The stack being accessed"
                  }
                },
                "required": ["stack"],
                "type": "object"
              },
              {
                "properties": {
                  "module": {
                    "$ref": "#/$defs/module",
                    "description": "The module being accessed"
                  }
                },
                "required": ["module"],
                "type": "object"
              }
            ]
          }
        ],
        "description": "Access policy input with mutually exclusive authentication and resource types"
      },
      "rules": {
        "properties": {
          "deny": {
            "description": "Deny all access to the stack or module, whatever the other rules decide",
            "type": "boolean"
          },
          "deny_write": {
            "description": "Suppress write access: when true, a write rule that would otherwise grant write access is ignored, leaving read access if the read rule grants it and denial otherwise",
            "type": "boolean"
          },
          "flag": {
            "$ref": "#/$defs/policy_flag"
          },
          "read": {
            "description": "Grant read access to the stack or module",
            "type": "boolean"
          },
          "reset_flag": {
            "$ref": "#/$defs/policy_reset_flag"
          },
          "sample": {
            "$ref": "#/$defs/policy_sample"
          },
          "write": {
            "description": "Grant write access to the stack or module. Write implies read",
            "type": "boolean"
          }
        },
        "type": "object"
      }
    },
    "APPROVAL": {
      "description": "Approval policies determine whether runs require manual approval before they can proceed.",
      "input": {
        "properties": {
          "reviews": {
            "properties": {
              "current": {
                "properties": {
                  "approvals": {
                    "description": "Current approvals for this run",
                    "items": {
                      "$ref": "#/$defs/run_approval_event"
                    },
                    "type": "array"
                  },
                  "rejections": {
                    "description": "Current rejections for this run",
                    "items": {
                      "$ref": "#/$defs/run_approval_event"
                    },
                    "type": "array"
                  }
                },
                "required": ["approvals", "rejections"],
                "type": "object",
                "description": "Reviews cast against the current state of the run"
              },
              "older": {
                "properties": {
                  "approvals": {
                    "description": "Previous approvals for this run",
                    "items": {
                      "$ref": "#/$defs/run_approval_event"
                    },
                    "type": "array"
                  },
                  "rejections": {
                    "description": "Previous rejections for this run",
                    "items": {
                      "$ref": "#/$defs/run_approval_event"
                    },
                    "type": "array"
                  }
                },
                "required": ["approvals", "rejections"],
                "type": "object",
                "description": "Reviews cast before the run last changed"
              }
            },
            "required": ["current", "older"],
            "type": "object",
            "description": "Approvals and rejections recorded for this run"
          },
          "run": {
            "$ref": "#/$defs/approval_run",
            "description": "The run awaiting approval with additional approval-specific fields"
          },
          "stack": {
            "$ref": "#/$defs/stack",
            "description": "Stack associated with the run"
          }
        },
        "required": ["run", "stack"],
        "type": "object"
      },
      "rules": {
        "properties": {
          "approve": {
            "description": "Approve the run and allow it to proceed",
            "type": "boolean"
          },
          "approve_with_note": {
            "description": "Reasons to approve the run. A non-empty list approves it, and each entry is recorded against the approval",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "flag": {
            "$ref": "#/$defs/policy_flag"
          },
          "reject": {
            "description": "Reject the run and prevent it from proceeding",
            "type": "boolean"
          },
          "reject_with_note": {
            "description": "Reasons to reject the run. A non-empty list rejects it, and each entry is recorded against the rejection",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "reset_flag": {
            "$ref": "#/$defs/policy_reset_flag"
          },
          "sample": {
            "$ref": "#/$defs/policy_sample"
          }
        },
        "type": "object"
      }
    },
    "GIT_PUSH": {
      "description": "Push policies are triggered by Git push events and determine how Spacelift should respond to repository changes.",
      "input": {
        "allOf": [
          {
            "properties": {
              "in_progress": {
                "anyOf": [
                  {
                    "items": {
                      "$ref": "#/$defs/push_in_progress_run"
                    },
                    "type": "array"
                  },
                  {
                    "type": "string",
                    "const": ""
                  }
                ],
                "description": "Runs currently in progress for this stack. The builders always emit an array, empty when there are none; the empty-string form is accepted because a stored input carried it"
              },
              "pull_request": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/pull_request_event"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Pull request information (for PR events)"
              },
              "push": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/push"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Push event information (may be null in some cases)"
              },
              "vcs_integration": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/vcs_integration"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "VCS integration information"
              }
            },
            "required": [],
            "type": "object"
          },
          {
            "oneOf": [
              {
                "properties": {
                  "stack": {
                    "$ref": "#/$defs/stack",
                    "description": "Stack that may be affected by this push"
                  }
                },
                "required": ["stack"],
                "type": "object"
              },
              {
                "properties": {
                  "module": {
                    "allOf": [
                      {
                        "$ref": "#/$defs/module"
                      },
                      {
                        "properties": {
                          "current_version": {
                            "description": "Number of the module's latest version. Reads 0.0.0 when the module has no version yet",
                            "type": "string"
                          }
                        },
                        "type": "object"
                      }
                    ],
                    "description": "Module that may be affected by this push"
                  }
                },
                "required": ["module"],
                "type": "object"
              }
            ]
          }
        ],
        "description": "Push policy input with either stack or module"
      },
      "rules": {
        "properties": {
          "allow_fork": {
            "description": "Allow a run for a pull request opened from a forked repository",
            "type": "boolean"
          },
          "cancel": {
            "description": "Identifiers of in-progress runs to cancel",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "external_dependency": {
            "description": "External dependency markers the resulting run must wait on",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "fail": {
            "description": "Report the push as failed against the commit",
            "type": "boolean"
          },
          "flag": {
            "$ref": "#/$defs/policy_flag"
          },
          "ignore": {
            "description": "Ignore the push entirely",
            "type": "boolean"
          },
          "ignore_track": {
            "description": "Suppress tracking: when true, a track rule that would otherwise track the commit is ignored, leaving a proposed run if the propose rule is set and ignoring the push otherwise",
            "type": "boolean"
          },
          "lock": {
            "description": "Lock the stack under this identifier. Every policy evaluated for the push must agree on the value",
            "type": "string"
          },
          "message": {
            "description": "Text to send as the commit status message in place of the default. Entries from every policy evaluated for the push are joined with a comma",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "module_version": {
            "description": "Version to publish when the push targets a module",
            "type": "string"
          },
          "notify": {
            "description": "Send a commit status check for a push Spacelift would otherwise ignore without one. Applies only to ignored pushes, so setting it false does not suppress checks for any other outcome",
            "type": "boolean"
          },
          "notrigger": {
            "description": "Track the commit without triggering a run for it",
            "type": "boolean"
          },
          "prioritize": {
            "description": "Put the resulting run ahead of others on a private worker pool queue",
            "type": "boolean"
          },
          "priority": {
            "description": "Priority level of the resulting run on a private worker pool queue: high, normal or low. Cannot be combined with prioritize",
            "type": "string",
            "enum": ["high", "normal", "low"]
          },
          "propose": {
            "description": "Trigger a proposed run without tracking the commit",
            "type": "boolean"
          },
          "reset_flag": {
            "$ref": "#/$defs/policy_reset_flag"
          },
          "sample": {
            "$ref": "#/$defs/policy_sample"
          },
          "track": {
            "description": "Track the pushed commit and trigger a tracked run",
            "type": "boolean"
          },
          "unlock": {
            "description": "Unlock the stack held under this identifier",
            "type": "string"
          }
        },
        "type": "object"
      }
    },
    "INTENT": {
      "description": "Intent policies control resource operations evaluated through the Intent API.",
      "input": {
        "properties": {
          "resource": {
            "description": "Resource operation being evaluated",
            "properties": {
              "resource_id": {
                "description": "Identifier of the resource being operated on",
                "type": "string"
              },
              "provider": {
                "description": "Provider name (e.g. hashicorp/aws)",
                "type": "string"
              },
              "provider_version": {
                "description": "Provider version (semver)",
                "type": "string"
              },
              "resource_type": {
                "description": "Resource type (e.g. aws_instance)",
                "type": "string"
              },
              "operation": {
                "description": "Operation being performed (create, update, delete, refresh, import)",
                "type": "string"
              },
              "current_state": {
                "description": "Current resource state. Keys are defined by the resource's provider, not by Spacelift",
                "type": ["object", "null"],
                "additionalProperties": true
              },
              "proposed_state": {
                "description": "Proposed resource state. Keys are defined by the resource's provider, not by Spacelift",
                "type": ["object", "null"],
                "additionalProperties": true
              }
            },
            "required": ["resource_id", "provider", "resource_type", "operation"],
            "type": "object"
          },
          "reviews": {
            "description": "Reviewer decisions on this operation",
            "properties": {
              "allow": {
                "description": "Reviews approving the operation, empty when there are none",
                "items": {
                  "$ref": "#/$defs/intent_review"
                },
                "type": "array"
              },
              "deny": {
                "description": "Reviews rejecting the operation, empty when there are none",
                "items": {
                  "$ref": "#/$defs/intent_review"
                },
                "type": "array"
              }
            },
            "type": "object"
          }
        },
        "required": ["resource"],
        "type": "object",
        "description": "Intent policy input: the resource operation plus any prior reviewer decisions"
      },
      "rules": {
        "properties": {
          "allow": {
            "description": "Reasons to allow the operation",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "deny": {
            "description": "Reasons to deny the operation (vetoes allow)",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "flag": {
            "$ref": "#/$defs/policy_flag"
          },
          "reset_flag": {
            "$ref": "#/$defs/policy_reset_flag"
          },
          "sample": {
            "$ref": "#/$defs/policy_sample"
          }
        },
        "type": "object"
      }
    },
    "LOGIN": {
      "description": "Login policies control user authentication and authorization.",
      "input": {
        "allOf": [
          {
            "properties": {
              "request": {
                "$ref": "#/$defs/request",
                "description": "Details about the login request"
              }
            },
            "required": ["request"],
            "type": "object"
          },
          {
            "oneOf": [
              {
                "properties": {
                  "session": {
                    "allOf": [
                      {
                        "$ref": "#/$defs/session"
                      },
                      {
                        "properties": {
                          "member": {
                            "description": "Whether the user is a member of the account",
                            "type": "boolean"
                          }
                        },
                        "required": ["member"],
                        "type": "object"
                      }
                    ],
                    "description": "Session information for the authenticating user"
                  }
                },
                "required": ["session"],
                "type": "object"
              },
              {
                "properties": {
                  "slack": {
                    "$ref": "#/$defs/slack",
                    "description": "Slack authentication information"
                  }
                },
                "required": ["slack"],
                "type": "object"
              }
            ]
          },
          {
            "properties": {
              "spaces": {
                "description": "Available spaces for the user",
                "items": {
                  "$ref": "#/$defs/space"
                },
                "type": "array"
              },
              "roles": {
                "description": "Available roles for the user",
                "items": {
                  "$ref": "#/$defs/role"
                },
                "type": "array"
              }
            },
            "type": "object"
          }
        ],
        "description": "Login policy input with mutually exclusive user and Slack authentication"
      },
      "rules": {
        "properties": {
          "admin": {
            "description": "Grant admin privileges to the user",
            "type": "boolean"
          },
          "allow": {
            "description": "Allow the login (non-admin access)",
            "type": "boolean"
          },
          "deny": {
            "description": "Deny the login attempt",
            "type": "boolean"
          },
          "deny_admin": {
            "description": "Deny admin privileges while leaving non-admin access intact",
            "type": "boolean"
          },
          "deny_message": {
            "description": "Messages shown to the user if the login is denied. A message never denies the login on its own; the allow, admin and deny rules decide that",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "flag": {
            "$ref": "#/$defs/policy_flag"
          },
          "reset_flag": {
            "$ref": "#/$defs/policy_reset_flag"
          },
          "roles": {
            "additionalProperties": {
              "anyOf": [
                {
                  "additionalProperties": {
                    "type": "boolean"
                  },
                  "description": "Role slugs granted in this space, keyed by slug. Only entries set to true are granted",
                  "type": "object"
                },
                {
                  "description": "Role slugs granted in this space",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              ]
            },
            "description": "Role slugs to grant, keyed by space slug",
            "type": "object"
          },
          "sample": {
            "$ref": "#/$defs/policy_sample",
            "description": "Advanced: whether to store this evaluation's input and result in the policy's evaluation records. Unlike every other policy type, login policies sample by default, so set this to false to opt out."
          },
          "space_admin": {
            "description": "List of spaces where the user should have admin access",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "space_read": {
            "description": "List of spaces where the user should have read access",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "space_write": {
            "description": "List of spaces where the user should have write access",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "team": {
            "description": "List of teams to assign to the user",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      }
    },
    "NOTIFICATION": {
      "description": "Notification policies control when and how notifications are sent for various Spacelift events.",
      "input": {
        "allOf": [
          {
            "properties": {
              "account": {
                "properties": {
                  "name": {
                    "description": "Account display name",
                    "type": "string"
                  }
                },
                "required": ["name"],
                "type": "object",
                "description": "The account the notification belongs to"
              },
              "webhook_endpoints": {
                "description": "Available webhook endpoints",
                "items": {
                  "$ref": "#/$defs/webhook_endpoint"
                },
                "type": "array"
              }
            },
            "required": ["account", "webhook_endpoints"],
            "type": "object"
          },
          {
            "allOf": [
              {
                "if": {
                  "properties": {
                    "internal_error": true
                  },
                  "required": ["internal_error"]
                },
                "then": {
                  "properties": {
                    "internal_error": {
                      "properties": {
                        "error": {
                          "description": "Error details",
                          "type": "string"
                        },
                        "message": {
                          "description": "Error message",
                          "type": "string"
                        },
                        "severity": {
                          "description": "Error severity level",
                          "type": "string"
                        }
                      },
                      "required": ["severity", "message", "error"],
                      "type": "object",
                      "description": "Set when Spacelift itself failed, rather than a run or module version changing"
                    }
                  },
                  "not": {
                    "anyOf": [
                      {"required": ["run_updated"]},
                      {"required": ["module_version"]},
                      {"required": ["worker_usage"]}
                    ]
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "run_updated": true
                  },
                  "required": ["run_updated"]
                },
                "then": {
                  "properties": {
                    "run_updated": {
                      "properties": {
                        "note": {
                          "description": "Optional note for the state transition",
                          "type": ["string", "null"]
                        },
                        "plan_policy_decision": {
                          "anyOf": [
                            {
                              "$ref": "#/$defs/plan_policy_outcome"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Plan policy outcome for the run"
                        },
                        "policy_receipts": {
                          "description": "Policy execution receipts. Null when the run has none",
                          "items": {
                            "$ref": "#/$defs/policy_receipt"
                          },
                          "type": ["array", "null"]
                        },
                        "run": {
                          "$ref": "#/$defs/notification_run",
                          "description": "The run that was updated"
                        },
                        "stack": {
                          "$ref": "#/$defs/stack",
                          "description": "Stack associated with the run"
                        },
                        "state": {
                          "description": "New run state",
                          "type": "string"
                        },
                        "timing": {
                          "description": "Time spent in each state the run has left. The state the run is in now has no entry, and the value is null until the run leaves its first state",
                          "items": {
                            "properties": {
                              "duration": {
                                "description": "Nanoseconds spent in the state",
                                "type": "integer"
                              },
                              "state": {
                                "description": "Run state",
                                "type": "string"
                              }
                            },
                            "required": ["duration", "state"],
                            "type": "object"
                          },
                          "type": ["array", "null"]
                        },
                        "urls": {
                          "description": "Related URLs",
                          "properties": {
                            "run": {
                              "description": "URL to the run",
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "username": {
                          "description": "User who triggered the state change",
                          "type": ["string", "null"]
                        }
                      },
                      "required": ["run", "stack", "timing", "policy_receipts", "urls"],
                      "type": "object",
                      "description": "Set when a run changed state"
                    }
                  },
                  "not": {
                    "anyOf": [
                      {"required": ["internal_error"]},
                      {"required": ["module_version"]},
                      {"required": ["worker_usage"]}
                    ]
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "module_version": true
                  },
                  "required": ["module_version"]
                },
                "then": {
                  "properties": {
                    "module_version": {
                      "properties": {
                        "module": {
                          "$ref": "#/$defs/module",
                          "description": "The module that has a new version"
                        },
                        "version": {
                          "$ref": "#/$defs/version",
                          "description": "The new module version"
                        }
                      },
                      "required": ["module", "version"],
                      "type": "object",
                      "description": "Set when a module version changed state"
                    }
                  },
                  "not": {
                    "anyOf": [
                      {"required": ["internal_error"]},
                      {"required": ["run_updated"]},
                      {"required": ["worker_usage"]}
                    ]
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "worker_usage": true
                  },
                  "required": ["worker_usage"]
                },
                "then": {
                  "properties": {
                    "worker_usage": {
                      "properties": {
                        "severity": {
                          "description": "Severity of the usage message",
                          "type": "string"
                        },
                        "message": {
                          "description": "Human-readable summary of the usage against the contract",
                          "type": "string"
                        },
                        "contracted_limit": {
                          "description": "Worker limit the contract allows",
                          "type": "integer"
                        },
                        "contracted_percentile": {
                          "description": "Percentile the contract bills concurrency at",
                          "type": "integer"
                        },
                        "concurrency_at_contracted_percentile": {
                          "description": "Concurrent workers at the contracted percentile over this billing cycle, up to the last midnight UTC",
                          "type": "integer"
                        },
                        "previous_concurrency_at_contracted_percentile": {
                          "description": "concurrency_at_contracted_percentile a day earlier",
                          "type": "integer"
                        },
                        "limit_ratio": {
                          "description": "concurrency_at_contracted_percentile over contracted_limit. Zero when the contract carries no worker cap, since there is nothing to be over",
                          "type": "number"
                        },
                        "previous_limit_ratio": {
                          "description": "limit_ratio a day earlier. Both figures are taken at a midnight, exactly a day apart, so comparing them fires once when a threshold is first crossed",
                          "type": "number"
                        },
                        "burst_budget_minutes": {
                          "description": "Minutes above the contracted limit the contract allows for the cycle",
                          "type": "integer"
                        },
                        "burst_used_minutes": {
                          "description": "Minutes spent above the contracted limit this cycle, up to the last midnight UTC",
                          "type": "integer"
                        },
                        "burst_remaining_minutes": {
                          "description": "burst_budget_minutes less burst_used_minutes, floored at zero",
                          "type": "integer"
                        },
                        "burst_ratio": {
                          "description": "burst_used_minutes over burst_budget_minutes. Zero when the contract allows no burst, since there is no budget to spend",
                          "type": "number"
                        },
                        "previous_burst_used_minutes": {
                          "description": "burst_used_minutes a day earlier",
                          "type": "integer"
                        },
                        "previous_burst_ratio": {
                          "description": "burst_ratio a day earlier. Compare with burst_ratio to fire once when a threshold is first crossed",
                          "type": "number"
                        },
                        "cycle_start": {
                          "description": "Start of the billing cycle, as Unix seconds",
                          "type": "integer"
                        },
                        "cycle_end": {
                          "description": "End of the billing cycle, as Unix seconds. Exclusive upper bound",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "severity",
                        "message",
                        "contracted_limit",
                        "contracted_percentile",
                        "concurrency_at_contracted_percentile",
                        "previous_concurrency_at_contracted_percentile",
                        "limit_ratio",
                        "previous_limit_ratio",
                        "burst_budget_minutes",
                        "burst_used_minutes",
                        "burst_remaining_minutes",
                        "burst_ratio",
                        "previous_burst_used_minutes",
                        "previous_burst_ratio",
                        "cycle_start",
                        "cycle_end"
                      ],
                      "type": "object",
                      "description": "Set when an account's private-worker usage is running into its contract"
                    }
                  },
                  "not": {
                    "anyOf": [
                      {"required": ["internal_error"]},
                      {"required": ["run_updated"]},
                      {"required": ["module_version"]}
                    ]
                  }
                }
              }
            ]
          },
          {
            "anyOf": [
              {"required": ["internal_error"]},
              {"required": ["run_updated"]},
              {"required": ["module_version"]},
              {"required": ["worker_usage"]}
            ]
          }
        ],
        "description": "Notification policy input with different event types"
      },
      "rules": {
        "properties": {
          "flag": {
            "$ref": "#/$defs/policy_flag"
          },
          "inbox": {
            "description": "Notifications to place in the Spacelift inbox",
            "items": {
              "properties": {
                "body": {
                  "type": "string",
                  "description": "A custom message body"
                },
                "severity": {
                  "type": "string",
                  "description": "Severity level for the message: INFO, WARNING or ERROR"
                },
                "title": {
                  "type": "string",
                  "description": "A custom title for the message"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "pull_request": {
            "description": "Comments to post on pull requests",
            "items": {
              "properties": {
                "body": {
                  "type": "string",
                  "description": "A custom comment body"
                },
                "branch": {
                  "type": "string",
                  "description": "Target branch"
                },
                "commit": {
                  "type": "string",
                  "description": "Target commit SHA"
                },
                "deduplication_key": {
                  "type": "string",
                  "description": "Key used to update an existing comment instead of adding another"
                },
                "id": {
                  "type": "integer",
                  "description": "Pull request identifier"
                },
                "truncate_body": {
                  "type": "boolean",
                  "description": "Whether to truncate a comment body that exceeds the provider's limit"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "reset_flag": {
            "$ref": "#/$defs/policy_reset_flag"
          },
          "sample": {
            "$ref": "#/$defs/policy_sample"
          },
          "slack": {
            "description": "Messages to send to Slack channels",
            "items": {
              "properties": {
                "channel_id": {
                  "type": "string",
                  "description": "The Slack channel the message is delivered to, taken from the bottom of the channel's About section"
                },
                "mention_groups": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array",
                  "description": "Groups to mention in the default message"
                },
                "mention_users": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array",
                  "description": "Users to mention in the default message"
                },
                "message": {
                  "type": "string",
                  "description": "A custom message to send instead of the default"
                },
                "thread_key": {
                  "type": "string",
                  "description": "Groups related messages into one Slack thread. The first message with a given key starts the thread and later ones reply to it"
                }
              },
              "required": ["channel_id"],
              "type": "object"
            },
            "type": "array"
          },
          "webhook": {
            "description": "Payloads to deliver to webhook endpoints",
            "items": {
              "properties": {
                "endpoint_id": {
                  "type": "string",
                  "description": "Slug of the endpoint the webhook is delivered to"
                },
                "headers": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object",
                  "description": "Headers to append to the request"
                },
                "method": {
                  "type": "string",
                  "description": "HTTP method to send the request with"
                },
                "payload": {
                  "description": "A custom JSON object to send as the request body"
                }
              },
              "required": ["endpoint_id"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      }
    },
    "PLAN": {
      "description": "Plan policies evaluate Terraform plans before they are applied.",
      "input": {
        "properties": {
          "ansible": {
            "description": "Ansible plan data, passed through as the vendor produced it",
            "type": ["object", "null"],
            "additionalProperties": true
          },
          "cloudformation": {
            "description": "CloudFormation plan data (for CloudFormation stacks)",
            "properties": {
              "changes": {
                "description": "Changes from the CloudFormation change set",
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": ["array", "null"]
              }
            },
            "type": ["object", "null"]
          },
          "kubernetes": {
            "description": "Kubernetes plan data, passed through as the vendor produced it",
            "type": ["object", "null"],
            "additionalProperties": true
          },
          "opentofu": {
            "description": "OpenTofu plan data (for OpenTofu stacks; also mirrored under terraform for backwards compatibility)",
            "properties": {
              "checks": {
                "description": "Check block results from the plan",
                "items": {
                  "$ref": "#/$defs/plan_check"
                },
                "type": "array"
              },
              "opentofu_version": {
                "description": "OpenTofu version that produced the plan",
                "type": "string"
              },
              "resource_changes": {
                "description": "Resource changes, as the vendor's plan JSON reports them",
                "items": {
                  "$ref": "#/$defs/plan_resource_change"
                },
                "type": ["array", "null"]
              }
            },
            "type": ["object", "null"]
          },
          "pulumi": {
            "description": "Pulumi plan data (for Pulumi stacks)",
            "properties": {
              "steps": {
                "description": "Steps from the Pulumi preview",
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": ["array", "null"]
              }
            },
            "type": ["object", "null"]
          },
          "spacelift": {
            "allOf": [
              {
                "properties": {
                  "commit": {
                    "$ref": "#/$defs/commit",
                    "description": "Git commit information"
                  },
                  "previous_run": {
                    "anyOf": [
                      {
                        "$ref": "#/$defs/plan_run"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Previous run information (if applicable)"
                  },
                  "request": {
                    "description": "Plan request details",
                    "properties": {
                      "timestamp_ns": {
                        "$ref": "#/$defs/timestamp",
                        "description": "Request timestamp"
                      }
                    },
                    "type": "object"
                  },
                  "run": {
                    "$ref": "#/$defs/plan_run",
                    "description": "Run information"
                  }
                },
                "required": ["commit", "request", "run"],
                "type": "object"
              },
              {
                "oneOf": [
                  {
                    "properties": {
                      "stack": {
                        "$ref": "#/$defs/stack",
                        "description": "Stack being planned"
                      }
                    },
                    "required": ["stack"],
                    "type": "object"
                  },
                  {
                    "properties": {
                      "module": {
                        "$ref": "#/$defs/module",
                        "description": "Module being planned"
                      }
                    },
                    "required": ["module"],
                    "type": "object"
                  }
                ]
              }
            ],
            "description": "Spacelift context with either stack or module"
          },
          "terraform": {
            "description": "Terraform plan data (for Terraform stacks; for OpenTofu stacks it mirrors opentofu for backwards compatibility)",
            "properties": {
              "checks": {
                "description": "Check block results from the plan",
                "items": {
                  "$ref": "#/$defs/plan_check"
                },
                "type": "array"
              },
              "resource_changes": {
                "description": "Resource changes, as the vendor's plan JSON reports them",
                "items": {
                  "$ref": "#/$defs/plan_resource_change"
                },
                "type": ["array", "null"]
              },
              "terraform_version": {
                "description": "Terraform version that produced the plan",
                "type": "string"
              }
            },
            "type": ["object", "null"]
          },
          "terragrunt": {
            "additionalProperties": {
              "description": "Plan for one Terragrunt project",
              "properties": {
                "checks": {
                  "description": "Check block results from the plan",
                  "items": {
                    "$ref": "#/$defs/plan_check"
                  },
                  "type": "array"
                },
                "resource_changes": {
                  "description": "Resource changes, as the vendor's plan JSON reports them",
                  "items": {
                    "$ref": "#/$defs/plan_resource_change"
                  },
                  "type": ["array", "null"]
                },
                "terraform_version": {
                  "description": "Terraform version that produced the plan",
                  "type": "string"
                }
              },
              "type": ["object", "null"]
            },
            "description": "Terragrunt plans, keyed by project",
            "type": ["object", "null"]
          },
          "third_party_metadata": {
            "description": "Third-party metadata (e.g., Infracost reports)",
            "type": ["object", "null"],
            "properties": {
              "custom": {
                "additionalProperties": true,
                "description": "Custom plan policy inputs, keyed by the file that supplied them: a file named wiz.custom.spacelift.json lands under the key wiz. Contents are defined by that file, not by Spacelift",
                "type": "object"
              },
              "infracost": {
                "additionalProperties": true,
                "description": "Infracost report, absent unless the run produced one. For Terragrunt it is keyed by project, for Terraform and OpenTofu it is the report itself. No other vendor emits it. Report contents are defined by Infracost, not by Spacelift",
                "type": "object"
              }
            }
          }
        },
        "required": ["spacelift"],
        "type": "object"
      },
      "rules": {
        "properties": {
          "deny": {
            "description": "List of reasons to block the plan from being applied",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "flag": {
            "$ref": "#/$defs/policy_flag"
          },
          "reset_flag": {
            "$ref": "#/$defs/policy_reset_flag"
          },
          "sample": {
            "$ref": "#/$defs/policy_sample"
          },
          "warn": {
            "description": "List of warnings about the plan",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      }
    },
    "TASK": {
      "description": "Task policies control the execution of administrative tasks within stacks.",
      "input": {
        "allOf": [
          {
            "properties": {
              "request": {
                "properties": {
                  "command": {
                    "description": "Command to be executed",
                    "type": "string"
                  },
                  "remote_ip": {
                    "description": "IP address of the request origin",
                    "type": "string"
                  },
                  "timestamp_ns": {
                    "$ref": "#/$defs/timestamp",
                    "description": "Request timestamp"
                  }
                },
                "required": ["command", "timestamp_ns"],
                "type": "object",
                "description": "Details about the task request"
              },
              "session": {
                "$ref": "#/$defs/session",
                "description": "Session information for the user executing the task"
              }
            },
            "required": ["request", "session"],
            "type": "object"
          },
          {
            "oneOf": [
              {
                "properties": {
                  "stack": {
                    "$ref": "#/$defs/stack",
                    "description": "Stack where the task is running"
                  }
                },
                "required": ["stack"],
                "type": "object"
              },
              {
                "properties": {
                  "module": {
                    "$ref": "#/$defs/module",
                    "description": "Module where the task is running"
                  }
                },
                "required": ["module"],
                "type": "object"
              }
            ]
          }
        ],
        "description": "Task policy input with either stack or module"
      },
      "rules": {
        "properties": {
          "deny": {
            "description": "List of reasons to block the task from executing",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "flag": {
            "$ref": "#/$defs/policy_flag"
          },
          "reset_flag": {
            "$ref": "#/$defs/policy_reset_flag"
          },
          "sample": {
            "$ref": "#/$defs/policy_sample"
          }
        },
        "type": "object"
      }
    },
    "TRIGGER": {
      "description": "Trigger policies are executed when tracked runs reach terminal states or when module versions are created.",
      "input": {
        "oneOf": [
          {
            "properties": {
              "run": {
                "$ref": "#/$defs/trigger_run",
                "description": "The completed run that triggered this policy"
              },
              "stack": {
                "$ref": "#/$defs/stack",
                "description": "Stack associated with the completed run"
              },
              "stacks": {
                "description": "List of candidate stacks for triggering",
                "items": {
                  "allOf": [
                    {
                      "$ref": "#/$defs/stack"
                    },
                    {
                      "properties": {
                        "queued_runs": {
                          "description": "Number of queued runs for this stack",
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    }
                  ]
                },
                "type": "array"
              },
              "workflow": {
                "description": "Workflow runs information",
                "items": {
                  "properties": {
                    "id": {
                      "description": "Run identifier",
                      "type": "string"
                    },
                    "stack_id": {
                      "description": "Stack identifier",
                      "type": "string"
                    },
                    "state": {
                      "description": "Run state",
                      "type": "string"
                    },
                    "type": {
                      "description": "Run type",
                      "type": "string"
                    }
                  },
                  "required": ["id", "stack_id", "state", "type"],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "required": ["run", "stack"],
            "type": "object",
            "description": "Trigger policy input triggered by a completed run"
          },
          {
            "properties": {
              "module": {
                "allOf": [
                  {
                    "$ref": "#/$defs/module"
                  },
                  {
                    "properties": {
                      "version": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/version"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "The version this evaluation concerns"
                      }
                    },
                    "type": "object"
                  }
                ],
                "description": "The module that had a new version"
              },
              "stacks": {
                "description": "List of candidate stacks for triggering",
                "items": {
                  "allOf": [
                    {
                      "$ref": "#/$defs/stack"
                    },
                    {
                      "properties": {
                        "queued_runs": {
                          "description": "Number of queued runs for this stack",
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    }
                  ]
                },
                "type": "array"
              }
            },
            "required": ["module", "stacks"],
            "type": "object",
            "description": "Trigger policy input triggered by a module version"
          }
        ],
        "description": "Trigger policy input with either run-triggered or version-triggered variants"
      },
      "rules": {
        "properties": {
          "flag": {
            "$ref": "#/$defs/policy_flag"
          },
          "priority": {
            "description": "Priority level of every run this policy triggers on a private worker pool queue: high, normal or low. Policies that disagree about one stack leave its run at normal",
            "type": "string",
            "enum": ["high", "normal", "low"]
          },
          "reset_flag": {
            "$ref": "#/$defs/policy_reset_flag"
          },
          "sample": {
            "$ref": "#/$defs/policy_sample"
          },
          "trigger": {
            "description": "List of stack IDs to trigger as a result of this run's completion",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      }
    }
  },
  "$defs": {
    "commit": {
      "properties": {
        "author": {
          "description": "Commit author",
          "type": "string"
        },
        "branch": {
          "description": "Git branch name",
          "type": "string"
        },
        "created_at": {
          "$ref": "#/$defs/timestamp",
          "description": "Commit creation timestamp"
        },
        "exist_on_tracked_branch": {
          "description": "Whether the commit exists on the tracked branch",
          "type": ["boolean", "null"]
        },
        "hash": {
          "description": "Git commit hash",
          "type": "string"
        },
        "message": {
          "description": "Commit message",
          "type": "string"
        },
        "pull_request_id": {
          "description": "Pull request ID if the commit is from a PR",
          "type": ["integer", "null"]
        },
        "tag": {
          "description": "Git tag, if any",
          "type": "string"
        },
        "url": {
          "description": "URL to the commit",
          "type": "string"
        }
      },
      "required": ["author", "branch", "created_at", "message"],
      "type": "object"
    },
    "intent_review": {
      "properties": {
        "author": {
          "description": "Username of the reviewer",
          "type": "string"
        },
        "request": {
          "additionalProperties": true,
          "description": "The request document as it stood when the review was recorded. Stored at the time, so its keys follow whichever version wrote it",
          "type": "object"
        },
        "session": {
          "additionalProperties": true,
          "description": "The session document as it stood when the review was recorded. Stored at the time, so its keys follow whichever version wrote it",
          "type": "object"
        }
      },
      "type": "object"
    },
    "module": {
      "properties": {
        "administrative": {
          "description": "Whether the module is administrative",
          "type": "boolean"
        },
        "branch": {
          "description": "Git branch tracked by this module",
          "type": "string"
        },
        "contexts": {
          "description": "Context slugs attached to the module",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "id": {
          "description": "Module identifier",
          "type": "string"
        },
        "labels": {
          "description": "Module labels",
          "items": {
            "type": "string"
          },
          "type": ["array", "null"]
        },
        "name": {
          "description": "Module name",
          "type": "string"
        },
        "namespace": {
          "description": "Module namespace",
          "type": "string"
        },
        "project_root": {
          "description": "Project root directory",
          "type": "string"
        },
        "repository": {
          "description": "Repository name",
          "type": "string"
        },
        "space": {
          "anyOf": [
            {
              "$ref": "#/$defs/space"
            },
            {
              "type": "null"
            }
          ],
          "description": "Space the module belongs to"
        },
        "terraform_provider": {
          "description": "Terraform provider for the module",
          "type": "string"
        },
        "worker_pool": {
          "anyOf": [
            {
              "$ref": "#/$defs/worker_pool"
            },
            {
              "type": "null"
            }
          ],
          "description": "Worker pool configuration"
        }
      },
      "required": ["administrative", "branch", "id", "name", "namespace", "project_root", "repository", "terraform_provider"],
      "type": "object"
    },
    "policy_flag": {
      "description": "Advanced: arbitrary strings to attach to this evaluation. Where the policy evaluates against a run, they appear on that run's policy receipt and are readable as run.flags by policies evaluated later for the same run.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "policy_reset_flag": {
      "description": "Advanced: flags to clear. A flag is only cleared once every policy that set it has also requested the reset, so one policy cannot clear another's flag.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "policy_sample": {
      "description": "Advanced: set to true to store this evaluation's input and result in the policy's evaluation records, where the policy workbench can replay it.",
      "type": "boolean"
    },
    "push": {
      "properties": {
        "affected_files": {
          "description": "List of files affected by the push",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "affected_stacks_count": {
          "description": "Stacks and modules on this repository, across all spaces of the account, whose project root or additional project globs match the affected files, including this one when it matches. Counted before any policy runs. It is the fan-out of the push, and the number of runs created can be lower.",
          "type": "integer"
        },
        "author": {
          "description": "Push author",
          "type": "string"
        },
        "branch": {
          "description": "Git branch",
          "type": "string"
        },
        "commits": {
          "description": "Individual commits batched into this push (e.g. by a merge queue), oldest first.",
          "items": {
            "allOf": [
              {
                "$ref": "#/$defs/commit"
              },
              {
                "properties": {
                  "affected_files": {
                    "description": "List of files affected by this individual commit",
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": ["affected_files"],
                "type": "object"
              }
            ]
          },
          "type": "array"
        },
        "created_at": {
          "$ref": "#/$defs/timestamp",
          "description": "Push timestamp"
        },
        "hash": {
          "description": "Git commit hash",
          "type": "string"
        },
        "message": {
          "description": "Commit message",
          "type": "string"
        },
        "tag": {
          "description": "Git tag if any",
          "type": "string"
        }
      },
      "required": ["affected_files", "affected_stacks_count", "author", "branch", "created_at", "hash", "message"],
      "type": "object"
    },
    "request": {
      "properties": {
        "remote_ip": {
          "description": "IP address of the request origin",
          "type": "string"
        },
        "timestamp_ns": {
          "$ref": "#/$defs/timestamp",
          "description": "Request timestamp"
        }
      },
      "type": "object"
    },
    "run_trigger": {
      "properties": {
        "run": {
          "description": "The triggering run",
          "properties": {
            "id": {
              "description": "Run identifier",
              "type": "string"
            }
          },
          "type": "object"
        },
        "trigger": {
          "anyOf": [
            {
              "$ref": "#/$defs/run_trigger"
            },
            {
              "type": "null"
            }
          ],
          "description": "The run that triggered the triggering run"
        }
      },
      "type": "object"
    },
    "session": {
      "properties": {
        "admin": {
          "description": "Whether the session has admin privileges. Absent from a login policy input, where an IdP admin does not reach the policy. An empty string on a run whose creator was a machine",
          "type": ["boolean", "string"]
        },
        "creator_ip": {
          "description": "IP address where the session was created",
          "type": "string"
        },
        "idp_subject": {
          "description": "Subject (sub) claim from the identity provider that authenticated the session. Empty only for a secret-based API key",
          "type": "string"
        },
        "login": {
          "description": "Login identifier",
          "type": "string"
        },
        "machine": {
          "description": "Whether the session belongs to a machine rather than a person. Always false in a login policy input",
          "type": "boolean"
        },
        "name": {
          "description": "Display name of the user",
          "type": "string"
        },
        "stack_id": {
          "description": "Slug of the stack whose run holds this session. Present only for a session Spacelift issued to a run, which a login policy never receives",
          "type": ["string", "null"]
        },
        "teams": {
          "description": "Teams the user belongs to",
          "items": {
            "type": "string"
          },
          "type": ["array", "null"]
        }
      },
      "required": ["machine", "teams"],
      "type": "object"
    },
    "slack": {
      "properties": {
        "channel": {
          "description": "Slack channel the command came from",
          "properties": {
            "id": {
              "description": "Slack channel identifier",
              "type": "string"
            },
            "name": {
              "description": "Slack channel name",
              "type": "string"
            }
          },
          "type": "object"
        },
        "command": {
          "description": "Slack command used",
          "type": "string"
        },
        "team": {
          "description": "Slack workspace the user belongs to",
          "properties": {
            "id": {
              "description": "Slack team identifier",
              "type": "string"
            },
            "name": {
              "description": "Slack team name",
              "type": "string"
            }
          },
          "type": "object"
        },
        "user": {
          "description": "Slack user who ran the command",
          "properties": {
            "deleted": {
              "description": "Whether the Slack account is deleted",
              "type": "boolean"
            },
            "display_name": {
              "description": "Display name from the user's Slack profile",
              "type": "string"
            },
            "enterprise": {
              "description": "Slack Enterprise Grid membership, zero valued outside an Enterprise workspace",
              "properties": {
                "enterprise_id": {
                  "description": "Enterprise Grid organisation identifier",
                  "type": "string"
                },
                "enterprise_name": {
                  "description": "Enterprise Grid organisation name",
                  "type": "string"
                },
                "id": {
                  "description": "Identifier of the user within the Enterprise Grid organisation",
                  "type": "string"
                },
                "is_admin": {
                  "description": "Whether the user administers the Enterprise Grid organisation",
                  "type": "boolean"
                },
                "is_owner": {
                  "description": "Whether the user owns the Enterprise Grid organisation",
                  "type": "boolean"
                },
                "teams": {
                  "description": "Workspaces within the organisation that the user belongs to",
                  "items": {
                    "type": "string"
                  },
                  "type": ["array", "null"]
                }
              },
              "type": "object"
            },
            "has_2fa": {
              "description": "Whether the user has two factor authentication enabled",
              "type": "boolean"
            },
            "id": {
              "description": "Slack user identifier",
              "type": "string"
            },
            "is_admin": {
              "description": "Whether the user administers the workspace",
              "type": "boolean"
            },
            "is_owner": {
              "description": "Whether the user owns the workspace",
              "type": "boolean"
            },
            "is_primary_owner": {
              "description": "Whether the user is the workspace's primary owner",
              "type": "boolean"
            },
            "is_restricted": {
              "description": "Whether the user is a multi-channel guest",
              "type": "boolean"
            },
            "is_stranger": {
              "description": "Whether the user belongs to no shared workspace",
              "type": "boolean"
            },
            "is_ultra_restricted": {
              "description": "Whether the user is a single-channel guest",
              "type": "boolean"
            },
            "real_name": {
              "description": "The user's real name as Slack holds it",
              "type": "string"
            },
            "tz": {
              "description": "The user's Slack timezone",
              "type": "string"
            }
          },
          "type": "object"
        }
      },
      "required": ["command", "user", "team", "channel"],
      "type": "object"
    },
    "space": {
      "properties": {
        "id": {
          "description": "Space identifier",
          "type": "string"
        },
        "labels": {
          "description": "Space labels",
          "items": {
            "type": "string"
          },
          "type": ["array", "null"]
        },
        "name": {
          "description": "Space display name",
          "type": "string"
        }
      },
      "required": ["id", "name", "labels"],
      "type": "object"
    },
    "stack": {
      "properties": {
        "additional_project_globs": {
          "description": "Additional project glob patterns",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "administrative": {
          "description": "Whether the stack is administrative",
          "type": "boolean"
        },
        "autodeploy": {
          "description": "Whether autodeploy is enabled",
          "type": "boolean"
        },
        "branch": {
          "description": "Git branch tracked by this stack",
          "type": "string"
        },
        "contexts": {
          "description": "Context slugs attached to the stack",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "id": {
          "description": "Stack identifier",
          "type": "string"
        },
        "labels": {
          "description": "Stack labels",
          "items": {
            "type": "string"
          },
          "type": ["array", "null"]
        },
        "locked_by": {
          "description": "User who locked the stack, if any",
          "type": ["string", "null"]
        },
        "name": {
          "description": "Stack display name",
          "type": "string"
        },
        "namespace": {
          "description": "Stack namespace",
          "type": "string"
        },
        "project_root": {
          "description": "Project root directory",
          "type": "string"
        },
        "repository": {
          "description": "Repository name",
          "type": "string"
        },
        "roles": {
          "description": "Spacelift roles granted on this stack",
          "items": {
            "$ref": "#/$defs/role"
          },
          "type": "array"
        },
        "space": {
          "anyOf": [
            {
              "$ref": "#/$defs/space"
            },
            {
              "type": "null"
            }
          ],
          "description": "Space the stack belongs to"
        },
        "state": {
          "description": "Current stack state",
          "type": "string"
        },
        "terraform_version": {
          "description": "Terraform version used by the stack (Terraform stacks only, null for other vendors)",
          "type": ["string", "null"]
        },
        "terraform_workflow_tool": {
          "description": "Terraform workflow tool (Terraform stacks only, null for other vendors)",
          "type": ["string", "null"]
        },
        "tracked_commit": {
          "anyOf": [
            {
              "$ref": "#/$defs/commit"
            },
            {
              "type": "null"
            }
          ],
          "description": "Currently tracked commit"
        },
        "worker_pool": {
          "anyOf": [
            {
              "$ref": "#/$defs/worker_pool"
            },
            {
              "type": "null"
            }
          ],
          "description": "Worker pool configuration"
        }
      },
      "required": ["administrative", "autodeploy", "branch", "id", "name", "namespace", "project_root", "repository", "state"],
      "type": "object"
    },
    "timestamp": {
      "description": "Unix timestamp in nanoseconds",
      "type": "integer"
    },
    "version": {
      "properties": {
        "commit": {
          "$ref": "#/$defs/commit",
          "description": "Git commit for this version"
        },
        "created_at": {
          "$ref": "#/$defs/timestamp",
          "description": "Version creation timestamp"
        },
        "id": {
          "description": "Version identifier",
          "type": "string"
        },
        "latest": {
          "description": "Whether this is the latest version",
          "type": "boolean"
        },
        "number": {
          "description": "Version number",
          "type": "string"
        },
        "state": {
          "description": "Version state",
          "type": "string"
        },
        "test_runs": {
          "description": "Test runs for this version",
          "items": {
            "description": "One test run for the version",
            "properties": {
              "created_at": {
                "description": "Creation Unix timestamp in nanoseconds",
                "type": "integer"
              },
              "id": {
                "description": "Run identifier",
                "type": "string"
              },
              "state": {
                "description": "Current run state",
                "type": "string"
              },
              "title": {
                "description": "Run title",
                "type": "string"
              },
              "updated_at": {
                "description": "Last update Unix timestamp in nanoseconds",
                "type": "integer"
              }
            },
            "type": "object"
          },
          "type": "array"
        }
      },
      "required": ["id", "number", "created_at", "state", "latest", "commit", "test_runs"],
      "type": "object"
    },
    "worker_pool": {
      "properties": {
        "id": {
          "description": "Worker pool identifier. Absent for the public pool rather than null",
          "type": "string"
        },
        "labels": {
          "description": "Worker pool labels. Absent for the public pool rather than null",
          "type": "array"
        },
        "name": {
          "description": "Worker pool name. Absent for the public pool rather than null",
          "type": "string"
        },
        "public": {
          "description": "Whether this is the public worker pool",
          "type": "boolean"
        }
      },
      "required": ["public"],
      "type": "object"
    },
    "role": {
      "properties": {
        "id": {
          "description": "Role identifier",
          "type": "string"
        },
        "name": {
          "description": "Role display name",
          "type": "string"
        },
        "slug": {
          "description": "Role slug",
          "type": "string"
        },
        "ulid": {
          "description": "Role ULID (Universally Unique Lexicographically Sortable Identifier)",
          "type": "string"
        }
      },
      "required": ["id", "name", "slug", "ulid"],
      "type": "object"
    },
    "webhook_endpoint": {
      "properties": {
        "id": {
          "description": "Webhook endpoint identifier",
          "type": "string"
        },
        "labels": {
          "description": "Webhook endpoint labels",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": ["id", "labels"],
      "type": "object"
    },
    "vcs_integration": {
      "properties": {
        "id": {
          "description": "VCS integration identifier",
          "type": "string"
        },
        "description": {
          "description": "VCS integration description",
          "type": "string"
        },
        "is_default": {
          "description": "Whether this is the default integration",
          "type": "boolean"
        },
        "labels": {
          "description": "VCS integration labels",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "name": {
          "description": "VCS integration name",
          "type": "string"
        },
        "space": {
          "anyOf": [
            {
              "$ref": "#/$defs/space"
            },
            {
              "type": "null"
            }
          ],
          "description": "Space the integration belongs to"
        },
        "provider": {
          "description": "VCS provider type",
          "type": "string"
        },
        "updated_at": {
          "$ref": "#/$defs/timestamp",
          "description": "Last update timestamp"
        },
        "created_at": {
          "$ref": "#/$defs/timestamp",
          "description": "Creation timestamp"
        }
      },
      "required": [],
      "type": "object"
    },
    "pull_request_event": {
      "properties": {
        "action_initiator": {
          "description": "Who initiated this PR action",
          "type": "string"
        },
        "action": {
          "description": "PR action type",
          "type": "string"
        },
        "affected_stacks_count": {
          "description": "Stacks and modules on this repository, across all spaces of the account, whose project root or additional project globs match the pull request's changed files, including this one when it matches. Counted before any policy runs. It is the fan-out of the event, and the number of runs created can be lower.",
          "type": "integer"
        },
        "author": {
          "description": "PR author",
          "type": "string"
        },
        "base": {
          "$ref": "#/$defs/commit",
          "description": "Base commit for the PR"
        },
        "closed": {
          "description": "Whether the PR is closed",
          "type": "boolean"
        },
        "diff": {
          "description": "Files affected by the PR",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "draft": {
          "description": "Whether this is a draft PR",
          "type": "boolean"
        },
        "head": {
          "$ref": "#/$defs/commit",
          "description": "Head commit for the PR"
        },
        "head_owner": {
          "description": "Owner of the head repository",
          "type": "string"
        },
        "id": {
          "description": "PR identifier",
          "type": "integer"
        },
        "labels": {
          "description": "PR labels",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "title": {
          "description": "PR title",
          "type": "string"
        },
        "approved": {
          "description": "Whether the PR is approved",
          "type": "boolean"
        },
        "mergeable": {
          "description": "Whether the PR is mergeable",
          "type": "boolean"
        },
        "undiverged": {
          "description": "Whether the PR is undiverged",
          "type": "boolean"
        },
        "comment": {
          "description": "Pull request comment, present only when the event carries one",
          "type": "string"
        }
      },
      "required": ["action", "affected_stacks_count", "author", "base", "closed", "diff", "draft", "head", "id", "labels", "title"],
      "type": "object"
    },
    "runtime_config": {
      "properties": {
        "git_sparse_checkout_paths": {
          "description": "Git sparse checkout paths",
          "items": {
            "type": "string"
          },
          "type": ["array", "null"]
        },
        "after_apply": {
          "description": "Commands to run after apply",
          "items": {
            "type": "string"
          },
          "type": ["array", "null"]
        },
        "after_destroy": {
          "description": "Commands to run after destroy",
          "items": {
            "type": "string"
          },
          "type": ["array", "null"]
        },
        "after_init": {
          "description": "Commands to run after init",
          "items": {
            "type": "string"
          },
          "type": ["array", "null"]
        },
        "after_perform": {
          "description": "Commands to run after perform",
          "items": {
            "type": "string"
          },
          "type": ["array", "null"]
        },
        "after_plan": {
          "description": "Commands to run after plan",
          "items": {
            "type": "string"
          },
          "type": ["array", "null"]
        },
        "after_run": {
          "description": "Commands to run after the entire run",
          "items": {
            "type": "string"
          },
          "type": ["array", "null"]
        },
        "before_apply": {
          "description": "Commands to run before apply",
          "items": {
            "type": "string"
          },
          "type": ["array", "null"]
        },
        "before_destroy": {
          "description": "Commands to run before destroy",
          "items": {
            "type": "string"
          },
          "type": ["array", "null"]
        },
        "before_init": {
          "description": "Commands to run before init",
          "items": {
            "type": "string"
          },
          "type": ["array", "null"]
        },
        "before_perform": {
          "description": "Commands to run before perform",
          "items": {
            "type": "string"
          },
          "type": ["array", "null"]
        },
        "before_plan": {
          "description": "Commands to run before plan",
          "items": {
            "type": "string"
          },
          "type": ["array", "null"]
        },
        "environment": {
          "description": "Environment variables for the run. Names are chosen by the account, not by Spacelift",
          "type": "object",
          "additionalProperties": true
        },
        "project_root": {
          "description": "Project root directory",
          "type": "string"
        },
        "runner_image": {
          "description": "Docker image used for the run",
          "type": "string"
        },
        "terraform_version": {
          "description": "Terraform version used by the run (Terraform stacks only, null for other vendors)",
          "type": ["string", "null"]
        }
      },
      "required": ["environment", "project_root", "runner_image", "terraform_version"],
      "type": "object"
    },
    "entity_change": {
      "properties": {
        "phase": {
          "description": "Phase of the change (plan or apply)",
          "type": "string"
        },
        "action": {
          "description": "Type of change action",
          "type": "string"
        },
        "moved": {
          "description": "Whether the entity was moved",
          "type": "boolean"
        },
        "entity": {
          "$ref": "#/$defs/entity",
          "description": "The entity the change applies to"
        }
      },
      "required": ["phase", "action", "entity"],
      "type": "object"
    },
    "run_approval_event": {
      "properties": {
        "author": {
          "description": "Author of the approval/rejection",
          "type": "string"
        },
        "author_roles": {
          "description": "Roles the author had at the time of the event",
          "items": {
            "$ref": "#/$defs/role"
          },
          "type": ["array", "null"]
        },
        "identity": {
          "$ref": "#/$defs/identity",
          "description": "Resolved identity of the reviewer, present when one resolves"
        },
        "note": {
          "description": "Note the reviewer left with the review, empty when they left none",
          "type": "string"
        },
        "request": {
          "additionalProperties": true,
          "description": "The request document as it stood when the review was recorded. Stored at the time, so its keys follow whichever version wrote it",
          "type": "object"
        },
        "session": {
          "additionalProperties": true,
          "description": "The session document as it stood when the review was recorded. Stored at the time, so its keys follow whichever version wrote it",
          "type": "object"
        },
        "state": {
          "description": "State of the approval event",
          "type": "string"
        },
        "state_version": {
          "description": "State version of the approval event",
          "type": "integer"
        }
      },
      "required": ["author", "state", "state_version"],
      "type": "object"
    },
    "policy_receipt": {
      "properties": {
        "type": {
          "description": "Policy type",
          "type": "string"
        },
        "name": {
          "description": "Policy name",
          "type": "string"
        },
        "outcome": {
          "description": "Policy execution outcome",
          "type": "string"
        },
        "flags": {
          "description": "Policy flags",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": ["type", "name", "outcome", "flags"],
      "type": "object"
    },
    "plan_policy_outcome": {
      "properties": {
        "deny": {
          "description": "List of deny reasons",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "warn": {
          "description": "List of warnings",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "approval_run": {
      "properties": {
        "based_on_local_workspace": {
          "description": "Whether the run is based on local workspace",
          "type": "boolean"
        },
        "branch": {
          "description": "Git branch for the run",
          "type": "string"
        },
        "changes": {
          "description": "Entity changes for the run",
          "items": {
            "$ref": "#/$defs/entity_change"
          },
          "type": "array"
        },
        "command": {
          "description": "Command executed for the run",
          "type": ["string", "null"]
        },
        "commit": {
          "$ref": "#/$defs/commit",
          "description": "Git commit for the run"
        },
        "created_at": {
          "$ref": "#/$defs/timestamp",
          "description": "Run creation timestamp"
        },
        "creator_session": {
          "allOf": [
            {
              "$ref": "#/$defs/session"
            },
            {
              "properties": {
                "identity": {
                  "$ref": "#/$defs/identity",
                  "description": "Resolved identity of the person who created the run, present when one resolves"
                }
              },
              "type": "object"
            }
          ],
          "description": "Session that created the run"
        },
        "drift_detection": {
          "description": "Whether this is a drift detection run",
          "type": "boolean"
        },
        "flags": {
          "description": "Flags set on this run by the flag rule of policies evaluated earlier for it",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "force_apply_mode": {
          "description": "Whether the apply phase is forced despite a zero-change plan",
          "enum": ["DISABLED", "SINGLE", "CASCADE"],
          "type": "string"
        },
        "id": {
          "description": "Run identifier",
          "type": "string"
        },
        "repository_runtime_config_changed": {
          "description": "Whether the repository runtime config has changed (approval-specific)",
          "type": "boolean"
        },
        "runtime_config": {
          "anyOf": [
            {
              "$ref": "#/$defs/runtime_config"
            },
            {
              "type": "null"
            }
          ],
          "description": "Runtime configuration for the run"
        },
        "state": {
          "description": "Current run state",
          "type": "string"
        },
        "trigger": {
          "anyOf": [
            {
              "$ref": "#/$defs/run_trigger"
            },
            {
              "type": "null"
            }
          ],
          "description": "The run that triggered this one, if any"
        },
        "triggered_by": {
          "description": "Who or what triggered the run",
          "type": ["string", "null"]
        },
        "type": {
          "description": "Run type (TRACKED, PROPOSED, etc.)",
          "type": "string"
        },
        "updated_at": {
          "$ref": "#/$defs/timestamp",
          "description": "Last update timestamp"
        },
        "user_provided_metadata": {
          "description": "User-provided metadata for the run",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": ["created_at", "id", "state", "triggered_by", "type", "updated_at"],
      "type": "object"
    },
    "plan_run": {
      "properties": {
        "based_on_local_workspace": {
          "description": "Whether the run is based on local workspace",
          "type": "boolean"
        },
        "branch": {
          "description": "Git branch for the run",
          "type": "string"
        },
        "changes": {
          "description": "Entity changes for the run",
          "items": {
            "$ref": "#/$defs/entity_change"
          },
          "type": "array"
        },
        "command": {
          "description": "Command executed for the run",
          "type": ["string", "null"]
        },
        "commit": {
          "$ref": "#/$defs/commit",
          "description": "Git commit for the run"
        },
        "created_at": {
          "$ref": "#/$defs/timestamp",
          "description": "Run creation timestamp"
        },
        "creator_session": {
          "allOf": [
            {
              "$ref": "#/$defs/session"
            },
            {
              "properties": {
                "identity": {
                  "$ref": "#/$defs/identity",
                  "description": "Resolved identity of the person who created the run, present when one resolves"
                }
              },
              "type": "object"
            }
          ],
          "description": "Session that created the run"
        },
        "drift_detection": {
          "description": "Whether this is a drift detection run",
          "type": "boolean"
        },
        "flags": {
          "description": "Flags set on this run by the flag rule of policies evaluated earlier for it",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "force_apply_mode": {
          "description": "Whether the apply phase is forced despite a zero-change plan",
          "enum": ["DISABLED", "SINGLE", "CASCADE"],
          "type": "string"
        },
        "id": {
          "description": "Run identifier",
          "type": "string"
        },
        "promoted": {
          "description": "Whether the run was promoted from a proposed run",
          "type": "boolean"
        },
        "runtime_config": {
          "anyOf": [
            {
              "$ref": "#/$defs/runtime_config"
            },
            {
              "type": "null"
            }
          ],
          "description": "Runtime configuration for the run"
        },
        "state": {
          "description": "Current run state",
          "type": "string"
        },
        "trigger": {
          "anyOf": [
            {
              "$ref": "#/$defs/run_trigger"
            },
            {
              "type": "null"
            }
          ],
          "description": "The run that triggered this one, if any"
        },
        "triggered_by": {
          "description": "Who or what triggered the run",
          "type": ["string", "null"]
        },
        "type": {
          "description": "Run type (TRACKED, PROPOSED, etc.)",
          "type": "string"
        },
        "updated_at": {
          "$ref": "#/$defs/timestamp",
          "description": "Last update timestamp"
        },
        "user_provided_metadata": {
          "description": "User-provided metadata for the run",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": ["created_at", "id", "state", "triggered_by", "type", "updated_at"],
      "type": "object"
    },
    "notification_run": {
      "properties": {
        "based_on_local_workspace": {
          "description": "Whether the run is based on local workspace",
          "type": "boolean"
        },
        "branch": {
          "description": "Git branch for the run",
          "type": "string"
        },
        "changes": {
          "description": "Entity changes for the run",
          "items": {
            "$ref": "#/$defs/entity_change"
          },
          "type": "array"
        },
        "command": {
          "description": "Command executed for the run",
          "type": ["string", "null"]
        },
        "commit": {
          "allOf": [
            {
              "$ref": "#/$defs/commit"
            },
            {
              "properties": {
                "author_identity": {
                  "$ref": "#/$defs/identity",
                  "description": "Resolved identity of the commit author, present when one resolves"
                }
              },
              "type": "object"
            }
          ],
          "description": "Git commit for the run"
        },
        "created_at": {
          "$ref": "#/$defs/timestamp",
          "description": "Run creation timestamp"
        },
        "creator_session": {
          "allOf": [
            {
              "$ref": "#/$defs/session"
            },
            {
              "properties": {
                "identity": {
                  "$ref": "#/$defs/identity",
                  "description": "Resolved identity of the person who created the run, present when one resolves"
                }
              },
              "type": "object"
            }
          ],
          "description": "Session that created the run"
        },
        "drift_detection": {
          "description": "Whether this is a drift detection run",
          "type": "boolean"
        },
        "flags": {
          "description": "Flags set on this run by the flag rule of policies evaluated earlier for it",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "force_apply_mode": {
          "description": "Whether the apply phase is forced despite a zero-change plan",
          "enum": ["DISABLED", "SINGLE", "CASCADE"],
          "type": "string"
        },
        "id": {
          "description": "Run identifier",
          "type": "string"
        },
        "promoted": {
          "description": "Whether the run was promoted from a proposed run",
          "type": "boolean"
        },
        "runtime_config": {
          "anyOf": [
            {
              "$ref": "#/$defs/runtime_config"
            },
            {
              "type": "null"
            }
          ],
          "description": "Runtime configuration for the run"
        },
        "state": {
          "description": "Current run state",
          "type": "string"
        },
        "states_history": {
          "description": "History of state transitions",
          "items": {
            "$ref": "#/$defs/state_transition"
          },
          "type": "array"
        },
        "trigger": {
          "anyOf": [
            {
              "$ref": "#/$defs/run_trigger"
            },
            {
              "type": "null"
            }
          ],
          "description": "The run that triggered this one, if any"
        },
        "triggered_by": {
          "description": "Who or what triggered the run",
          "type": ["string", "null"]
        },
        "type": {
          "description": "Run type (TRACKED, PROPOSED, etc.)",
          "type": "string"
        },
        "updated_at": {
          "$ref": "#/$defs/timestamp",
          "description": "Last update timestamp"
        },
        "user_provided_metadata": {
          "description": "User-provided metadata for the run",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": ["created_at", "id", "state", "triggered_by", "type", "updated_at"],
      "type": "object"
    },
    "trigger_run": {
      "properties": {
        "based_on_local_workspace": {
          "description": "Whether the run is based on local workspace",
          "type": "boolean"
        },
        "branch": {
          "description": "Git branch for the run",
          "type": "string"
        },
        "changes": {
          "description": "Entity changes for the run",
          "items": {
            "$ref": "#/$defs/entity_change"
          },
          "type": "array"
        },
        "command": {
          "description": "Command executed for the run",
          "type": ["string", "null"]
        },
        "commit": {
          "$ref": "#/$defs/commit",
          "description": "Git commit for the run"
        },
        "created_at": {
          "$ref": "#/$defs/timestamp",
          "description": "Run creation timestamp"
        },
        "creator_session": {
          "allOf": [
            {
              "$ref": "#/$defs/session"
            },
            {
              "properties": {
                "identity": {
                  "$ref": "#/$defs/identity",
                  "description": "Resolved identity of the person who created the run, present when one resolves"
                }
              },
              "type": "object"
            }
          ],
          "description": "Session that created the run"
        },
        "drift_detection": {
          "description": "Whether this is a drift detection run",
          "type": "boolean"
        },
        "flags": {
          "description": "Flags set on this run by the flag rule of policies evaluated earlier for it",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "force_apply_mode": {
          "description": "Whether the apply phase is forced despite a zero-change plan",
          "enum": ["DISABLED", "SINGLE", "CASCADE"],
          "type": "string"
        },
        "id": {
          "description": "Run identifier",
          "type": "string"
        },
        "priority": {
          "description": "Tier the run was queued in, one of high, normal or low",
          "type": "string"
        },
        "promoted": {
          "description": "Whether the run was promoted from a proposed run",
          "type": "boolean"
        },
        "runtime_config": {
          "anyOf": [
            {
              "$ref": "#/$defs/runtime_config"
            },
            {
              "type": "null"
            }
          ],
          "description": "Runtime configuration for the run"
        },
        "state": {
          "description": "Current run state - must be terminal",
          "enum": ["FINISHED", "FAILED", "CANCELED", "DISCARDED", "STOPPED", "SKIPPED"],
          "type": "string"
        },
        "states_history": {
          "description": "History of state transitions",
          "items": {
            "$ref": "#/$defs/state_transition"
          },
          "type": "array"
        },
        "trigger": {
          "anyOf": [
            {
              "$ref": "#/$defs/run_trigger"
            },
            {
              "type": "null"
            }
          ],
          "description": "The run that triggered this one, if any"
        },
        "triggered_by": {
          "description": "Who or what triggered the run",
          "type": ["string", "null"]
        },
        "type": {
          "description": "Run type (TRACKED, PROPOSED, etc.)",
          "type": "string"
        },
        "updated_at": {
          "$ref": "#/$defs/timestamp",
          "description": "Last update timestamp"
        },
        "user_provided_metadata": {
          "description": "User-provided metadata for the run",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": ["created_at", "id", "priority", "state", "triggered_by", "type", "updated_at"],
      "type": "object"
    },
    "push_in_progress_run": {
      "properties": {
        "based_on_local_workspace": {
          "description": "Whether the run is based on local workspace",
          "type": "boolean"
        },
        "branch": {
          "description": "Git branch for the run",
          "type": "string"
        },
        "command": {
          "description": "Command executed for the run",
          "type": ["string", "null"]
        },
        "commit": {
          "$ref": "#/$defs/commit",
          "description": "Git commit for the run"
        },
        "created_at": {
          "$ref": "#/$defs/timestamp",
          "description": "Run creation timestamp"
        },
        "drift_detection": {
          "description": "Whether this is a drift detection run",
          "type": "boolean"
        },
        "force_apply_mode": {
          "description": "Whether the apply phase is forced despite a zero-change plan",
          "enum": ["DISABLED", "SINGLE", "CASCADE"],
          "type": "string"
        },
        "id": {
          "description": "Run identifier",
          "type": "string"
        },
        "state": {
          "description": "Current run state",
          "type": "string"
        },
        "trigger": {
          "anyOf": [
            {
              "$ref": "#/$defs/run_trigger"
            },
            {
              "type": "null"
            }
          ],
          "description": "The run that triggered this one, if any"
        },
        "triggered_by": {
          "description": "Who or what triggered the run",
          "type": ["string", "null"]
        },
        "type": {
          "description": "Run type (TRACKED, PROPOSED, etc.)",
          "type": "string"
        },
        "updated_at": {
          "$ref": "#/$defs/timestamp",
          "description": "Last update timestamp"
        },
        "user_provided_metadata": {
          "description": "User-provided metadata for the run",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": ["created_at", "id", "state", "triggered_by", "type", "updated_at"],
      "type": "object"
    },
    "entity": {
      "description": "One resource, output, stack, module or Ansible task in a plan or apply",
      "properties": {
        "address": {
          "description": "Address of the entity",
          "type": "string"
        },
        "data": {
          "description": "Vendor specific detail. Which keys are present depends on entity_vendor and entity_type",
          "properties": {
            "address": {
              "description": "Terraform resource address",
              "type": "string"
            },
            "id": {
              "description": "Pulumi resource identifier",
              "type": "string"
            },
            "logical_resource_id": {
              "description": "CloudFormation logical resource identifier",
              "type": "string"
            },
            "mode": {
              "description": "Terraform resource mode",
              "type": "string"
            },
            "module": {
              "description": "Terraform module the resource belongs to",
              "type": "string"
            },
            "outputs": {
              "additionalProperties": true,
              "description": "Pulumi resource outputs. Keys are defined by the resource, not by Spacelift",
              "type": "object"
            },
            "outputs_hash": {
              "description": "Hash of the Pulumi resource outputs",
              "type": "integer"
            },
            "parent": {
              "description": "Pulumi parent resource",
              "type": "string"
            },
            "physical_resource_id": {
              "description": "CloudFormation physical resource identifier",
              "type": "string"
            },
            "provider": {
              "description": "Provider that manages the resource",
              "type": "string"
            },
            "sensitive": {
              "description": "Whether the output is sensitive",
              "type": "boolean"
            },
            "tainted": {
              "description": "Whether Terraform marked the resource tainted",
              "type": "boolean"
            },
            "template": {
              "description": "CloudFormation template describing the resource"
            },
            "urn": {
              "description": "Pulumi resource URN",
              "type": "string"
            },
            "value": {
              "description": "Output value, empty when the output holds no value",
              "type": "string"
            },
            "value_hash": {
              "description": "Hash of the output value",
              "type": "integer"
            },
            "values": {
              "additionalProperties": true,
              "description": "Terraform resource attributes. Keys are defined by the resource's provider, not by Spacelift",
              "type": "object"
            },
            "values_hash": {
              "description": "Hash of the Terraform resource attributes",
              "type": "integer"
            }
          },
          "type": "object"
        },
        "entity_type": {
          "description": "What kind of entity this is: resource, output, stack or module",
          "type": "string"
        },
        "entity_vendor": {
          "description": "Which vendor produced the entity: terraform, opentofu, pulumi or cloudformation. Legacy OpenTofu stacks (Terraform vendor with the OPEN_TOFU workflow tool) report terraform",
          "type": "string"
        },
        "host_name": {
          "description": "Ansible host the task ran against",
          "type": "string"
        },
        "name": {
          "description": "Name of the entity",
          "type": "string"
        },
        "playbook_name": {
          "description": "Ansible playbook the task belongs to",
          "type": "string"
        },
        "role_name": {
          "description": "Ansible role the task belongs to, empty when it has none",
          "type": "string"
        },
        "task_action": {
          "description": "Ansible task action",
          "type": "string"
        },
        "task_name": {
          "description": "Ansible task name",
          "type": "string"
        },
        "type": {
          "description": "Type of the entity as the vendor reports it",
          "type": "string"
        }
      },
      "type": "object"
    },
    "identity": {
      "description": "A resolved Spacelift identity for the person who acted",
      "properties": {
        "federations": {
          "additionalProperties": {
            "properties": {
              "id": {
                "description": "The person's external identifier for this provider",
                "type": "string"
              },
              "username": {
                "description": "The person's external username for this provider, when the provider reports one",
                "type": "string"
              }
            },
            "type": "object"
          },
          "description": "External accounts linked to this identity, keyed by provider",
          "type": "object"
        },
        "ulid": {
          "description": "Opaque reference to the identity",
          "type": "string"
        }
      },
      "type": "object"
    },
    "plan_resource_change": {
      "additionalProperties": true,
      "properties": {
        "address": {
          "description": "Absolute resource address",
          "type": "string"
        },
        "change": {
          "additionalProperties": true,
          "description": "The change Terraform plans for this resource",
          "properties": {
            "actions": {
              "description": "One or more of no-op, create, read, update, delete",
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "after": {
              "additionalProperties": true,
              "description": "Attributes after the change, null when the action is delete. Keys are defined by the resource's provider, not by Spacelift",
              "type": ["object", "null"]
            },
            "after_unknown": {
              "additionalProperties": true,
              "description": "Attributes whose values are not known until apply. Keys are provider-defined",
              "type": "object"
            },
            "before": {
              "additionalProperties": true,
              "description": "Attributes before the change, null when the action is create. Keys are defined by the resource's provider, not by Spacelift",
              "type": ["object", "null"]
            }
          },
          "type": "object"
        },
        "mode": {
          "description": "Either managed or data",
          "type": "string"
        },
        "module_address": {
          "description": "Address of the module containing the resource",
          "type": "string"
        },
        "name": {
          "description": "Resource name within its module",
          "type": "string"
        },
        "provider_name": {
          "description": "Provider that manages the resource",
          "type": "string"
        },
        "type": {
          "description": "Resource type, for example aws_iam_user",
          "type": "string"
        }
      },
      "type": "object"
    },
    "plan_check": {
      "additionalProperties": true,
      "description": "One check block result, as the vendor's plan JSON reports it. The vendor controls its keys",
      "type": "object"
    },
    "state_transition": {
      "description": "One state a run passed through",
      "properties": {
        "new_state": {
          "description": "The state the run moved into",
          "type": "string"
        },
        "note": {
          "description": "Note recorded with the transition, present only when one was given",
          "type": "string"
        },
        "username": {
          "description": "Person who caused the transition, present only when a person did",
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}
