{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://unblock.esh.sh/schema.json",
  "title": "Unblock board",
  "description": "A todo list whose tasks form a directed acyclic graph. Structural rules JSON Schema can't express (ids must exist, no dependency loops, no waiting on your own group) are checked by the app and by `unblock.py validate`.",
  "type": "object",
  "required": ["tasks"],
  "properties": {
    "$schema": { "type": "string", "description": "Where this schema lives, so editors check and autocomplete the file: https://unblock.esh.sh/schema.json" },
    "format": { "const": "unblock/v1" },
    "title": { "type": "string" },
    "updatedAt": { "type": "string", "description": "Deprecated and no longer written: rewriting it on every save made branches conflict. Git records when the file changed. Older files may still have it." },
    "view": {
      "type": "object",
      "description": "Display state only. Never affects the computed numbers.",
      "properties": {
        "collapsed": { "type": "array", "items": { "type": "string" }, "description": "Ids of groups shown folded." }
      }
    },
    "tasks": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id"],
        "properties": {
          "id": { "type": "string", "minLength": 1, "description": "Unique and stable. Links and parents refer to it." },
          "title": { "type": "string" },
          "status": {
            "enum": ["todo", "doing", "done"],
            "description": "Only meaningful on tasks without children. Ready and Blocked are computed from dependencies, never stored."
          },
          "parent": { "type": "string", "description": "Id of the group this task sits in. Any task with children is a group." },
          "dependsOn": {
            "type": "array",
            "items": { "type": "string" },
            "uniqueItems": true,
            "description": "Ids that must be done before this task can start. A group id means every task inside that group. A group's own dependsOn applies to everything inside it."
          },
          "estimate": { "type": "number", "minimum": 0, "description": "Weight used by every percentage. Defaults to 1." },
          "assignee": { "type": "string" },
          "touches": {
            "type": "array",
            "items": { "type": "string" },
            "description": "Paths the task will likely edit, as patterns such as src/auth/**. Starting several agents warns when two picked tasks overlap."
          },
          "ref": {
            "type": "string",
            "description": "Another board this task stands for, or a task in it: owner/repo, owner/repo#task, owner/repo:path/board.json#task, or a path on disk such as ../api/.github/unblock.json#task. The task follows its state (unblock sync)."
          },
          "issue": {
            "type": "string",
            "pattern": "^([A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+)?#[0-9]+$",
            "description": "The GitHub issue this task is: owner/repo#123, or #123 in the board's repository. The task is marked done when the issue closes (unblock sync, or the workflow after a merge)."
          },
          "tags": { "type": "array", "items": { "type": "string" } },
          "notes": { "type": "string" }
        },
        "additionalProperties": true
      }
    }
  },
  "additionalProperties": true
}
