{
  "$defs": {
    "RawAutoSync": {
      "additionalProperties": false,
      "description": "Nested ``gatekeeping.auto_sync`` settings.",
      "properties": {
        "enabled": {
          "default": false,
          "title": "Enabled",
          "type": "boolean"
        },
        "branches": {
          "items": {
            "type": "string"
          },
          "title": "Branches",
          "type": "array"
        }
      },
      "title": "RawAutoSync",
      "type": "object"
    },
    "RawDockerSection": {
      "additionalProperties": false,
      "description": "The ``docker:`` section of project.yml.",
      "properties": {
        "base_image": {
          "default": "ubuntu:24.04",
          "title": "Base Image",
          "type": "string"
        },
        "user_snippet_inline": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "User Snippet Inline"
        },
        "user_snippet_file": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "User Snippet File"
        }
      },
      "title": "RawDockerSection",
      "type": "object"
    },
    "RawGateSection": {
      "additionalProperties": false,
      "description": "The ``gate:`` section of project.yml.",
      "properties": {
        "path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Path"
        }
      },
      "title": "RawGateSection",
      "type": "object"
    },
    "RawGatekeepingSection": {
      "additionalProperties": false,
      "description": "The ``gatekeeping:`` section of project.yml.",
      "properties": {
        "staging_root": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Staging Root"
        },
        "expose_external_remote": {
          "default": false,
          "title": "Expose External Remote",
          "type": "boolean"
        },
        "upstream_polling": {
          "$ref": "#/$defs/RawUpstreamPolling"
        },
        "auto_sync": {
          "$ref": "#/$defs/RawAutoSync"
        }
      },
      "title": "RawGatekeepingSection",
      "type": "object"
    },
    "RawGitSection": {
      "additionalProperties": false,
      "description": "The ``git:`` section of project.yml.",
      "properties": {
        "upstream_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Upstream Url"
        },
        "default_branch": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Default Branch"
        },
        "human_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Human Name"
        },
        "human_email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Human Email"
        },
        "authorship": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Authorship"
        }
      },
      "title": "RawGitSection",
      "type": "object"
    },
    "RawHooksSection": {
      "additionalProperties": false,
      "description": "Task lifecycle hook commands (run on host, not inside containers).",
      "properties": {
        "pre_start": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Pre Start"
        },
        "post_start": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Post Start"
        },
        "post_ready": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Post Ready"
        },
        "post_stop": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Post Stop"
        }
      },
      "title": "RawHooksSection",
      "type": "object"
    },
    "RawProjectSection": {
      "additionalProperties": false,
      "description": "The ``project:`` section of project.yml.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Human-readable project name",
          "title": "Name"
        },
        "security_class": {
          "default": "online",
          "description": "online or gatekeeping",
          "title": "Security Class",
          "type": "string"
        }
      },
      "title": "RawProjectSection",
      "type": "object"
    },
    "RawRunSection": {
      "additionalProperties": false,
      "description": "The ``run:`` section of project.yml.",
      "properties": {
        "shutdown_timeout": {
          "default": 10,
          "title": "Shutdown Timeout",
          "type": "integer"
        },
        "gpus": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Gpus"
        },
        "hooks": {
          "$ref": "#/$defs/RawHooksSection"
        }
      },
      "title": "RawRunSection",
      "type": "object"
    },
    "RawSSHSection": {
      "additionalProperties": false,
      "description": "The ``ssh:`` section of project.yml.",
      "properties": {
        "key_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Key Name"
        },
        "host_dir": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Host-side SSH directory",
          "title": "Host Dir"
        },
        "config_template": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Config Template"
        }
      },
      "title": "RawSSHSection",
      "type": "object"
    },
    "RawShieldProjectSection": {
      "additionalProperties": false,
      "description": "The ``shield:`` section of project.yml.\n\nBoth fields default to ``None`` (inherit from global ``config.yml``).",
      "properties": {
        "drop_on_task_run": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Drop On Task Run"
        },
        "on_task_restart": {
          "anyOf": [
            {
              "enum": [
                "retain",
                "up"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "On Task Restart"
        }
      },
      "title": "RawShieldProjectSection",
      "type": "object"
    },
    "RawTasksSection": {
      "additionalProperties": false,
      "description": "The ``tasks:`` section of project.yml.",
      "properties": {
        "root": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Root"
        },
        "name_categories": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name Categories"
        }
      },
      "title": "RawTasksSection",
      "type": "object"
    },
    "RawUpstreamPolling": {
      "additionalProperties": false,
      "description": "Nested ``gatekeeping.upstream_polling`` settings.",
      "properties": {
        "enabled": {
          "default": true,
          "title": "Enabled",
          "type": "boolean"
        },
        "interval_minutes": {
          "default": 5,
          "title": "Interval Minutes",
          "type": "integer"
        }
      },
      "title": "RawUpstreamPolling",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "description": "Validated structure of a ``project.yml`` file.",
  "properties": {
    "project": {
      "$ref": "#/$defs/RawProjectSection"
    },
    "git": {
      "$ref": "#/$defs/RawGitSection"
    },
    "ssh": {
      "$ref": "#/$defs/RawSSHSection"
    },
    "tasks": {
      "$ref": "#/$defs/RawTasksSection"
    },
    "gate": {
      "$ref": "#/$defs/RawGateSection"
    },
    "gatekeeping": {
      "$ref": "#/$defs/RawGatekeepingSection"
    },
    "run": {
      "$ref": "#/$defs/RawRunSection"
    },
    "shield": {
      "$ref": "#/$defs/RawShieldProjectSection"
    },
    "docker": {
      "$ref": "#/$defs/RawDockerSection"
    },
    "default_agent": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Default Agent"
    },
    "default_login": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Default Login"
    },
    "agent": {
      "additionalProperties": true,
      "title": "Agent",
      "type": "object"
    }
  },
  "title": "terok project.yml",
  "type": "object",
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
