{
  "schemaVersion": "dancer-goals/v1",
  "supported": true,
  "enabled": false,
  "limits": {
    "requestMaxBytes": 32768,
    "responseMaxBytes": 49152,
    "pageMax": 50,
    "authorizationMaxMs": 10000
  },
  "operations": {
    "goals.operation.get": {
      "method": "GET",
      "path": "/v1/messages/projects/{projectId}/goal-operations/{operationKey}",
      "action": {
        "sameAs": "input.sourceOperation"
      },
      "mutation": false,
      "request": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "operation": {
            "type": "string",
            "const": "goals.operation.get"
          },
          "projectId": {
            "type": "string",
            "pattern": "^prj_[a-f0-9]{32}$"
          },
          "goalId": {
            "type": "string",
            "pattern": "^thr_[a-f0-9]{32}$"
          },
          "input": {
            "type": "object",
            "properties": {
              "sourceOperation": {
                "type": "string",
                "enum": [
                  "goals.create",
                  "goals.update",
                  "goals.claim",
                  "goals.check_in",
                  "goals.transfer",
                  "goals.release"
                ]
              },
              "operationKey": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
              },
              "requestDigest": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            },
            "required": [
              "sourceOperation",
              "operationKey",
              "requestDigest"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "operation",
          "projectId",
          "input"
        ],
        "additionalProperties": false
      },
      "response": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "type": "string",
                "const": "dancer-goals/v1"
              },
              "ok": {
                "type": "boolean",
                "const": true
              },
              "scope": {
                "type": "object",
                "properties": {
                  "organizationId": {
                    "type": "string",
                    "maxLength": 128,
                    "pattern": "^org_[A-Za-z0-9_-]+$"
                  },
                  "projectId": {
                    "type": "string",
                    "pattern": "^prj_[a-f0-9]{32}$"
                  },
                  "goalId": {
                    "type": "string",
                    "pattern": "^thr_[a-f0-9]{32}$"
                  }
                },
                "required": [
                  "organizationId",
                  "projectId"
                ],
                "additionalProperties": false
              },
              "status": {
                "type": "string",
                "const": "confirmed_absent"
              }
            },
            "required": [
              "schemaVersion",
              "ok",
              "scope",
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "type": "string",
                "const": "dancer-goals/v1"
              },
              "ok": {
                "type": "boolean",
                "const": true
              },
              "scope": {
                "type": "object",
                "properties": {
                  "organizationId": {
                    "type": "string",
                    "maxLength": 128,
                    "pattern": "^org_[A-Za-z0-9_-]+$"
                  },
                  "projectId": {
                    "type": "string",
                    "pattern": "^prj_[a-f0-9]{32}$"
                  },
                  "goalId": {
                    "type": "string",
                    "pattern": "^thr_[a-f0-9]{32}$"
                  }
                },
                "required": [
                  "organizationId",
                  "projectId"
                ],
                "additionalProperties": false
              },
              "status": {
                "type": "string",
                "const": "committed"
              },
              "result": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "schemaVersion": {
                        "type": "string",
                        "const": "dancer-goals/v1"
                      },
                      "ok": {
                        "type": "boolean",
                        "const": true
                      },
                      "scope": {
                        "type": "object",
                        "properties": {
                          "organizationId": {
                            "type": "string",
                            "maxLength": 128,
                            "pattern": "^org_[A-Za-z0-9_-]+$"
                          },
                          "projectId": {
                            "type": "string",
                            "pattern": "^prj_[a-f0-9]{32}$"
                          },
                          "goalId": {
                            "type": "string",
                            "pattern": "^thr_[a-f0-9]{32}$"
                          }
                        },
                        "required": [
                          "organizationId",
                          "projectId",
                          "goalId"
                        ],
                        "additionalProperties": false
                      },
                      "goal": {
                        "type": "object",
                        "properties": {
                          "schemaVersion": {
                            "type": "string",
                            "const": "dancer-goals/v1"
                          },
                          "organizationId": {
                            "type": "string",
                            "maxLength": 128,
                            "pattern": "^org_[A-Za-z0-9_-]+$"
                          },
                          "projectId": {
                            "type": "string",
                            "pattern": "^prj_[a-f0-9]{32}$"
                          },
                          "goalId": {
                            "type": "string",
                            "pattern": "^thr_[a-f0-9]{32}$"
                          },
                          "title": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 140
                          },
                          "outcome": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 2000
                          },
                          "externalReference": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 2048,
                                "format": "uri"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "managerId": {
                            "type": "string",
                            "pattern": "^agt_[a-z0-9]{16,64}$"
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "active",
                              "paused",
                              "closed"
                            ]
                          },
                          "revision": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "createdAtMs": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "updatedAtMs": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "schemaVersion",
                          "organizationId",
                          "projectId",
                          "goalId",
                          "title",
                          "outcome",
                          "externalReference",
                          "managerId",
                          "state",
                          "revision",
                          "createdAtMs",
                          "updatedAtMs"
                        ],
                        "additionalProperties": false
                      },
                      "receipt": {
                        "type": "object",
                        "properties": {
                          "operationId": {
                            "type": "string",
                            "pattern": "^gop_[a-f0-9]{32}$"
                          },
                          "committedAtMs": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "revision": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "replayed": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "operationId",
                          "committedAtMs",
                          "revision",
                          "replayed"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "schemaVersion",
                      "ok",
                      "scope",
                      "goal",
                      "receipt"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "schemaVersion": {
                        "type": "string",
                        "const": "dancer-goals/v1"
                      },
                      "ok": {
                        "type": "boolean",
                        "const": true
                      },
                      "scope": {
                        "type": "object",
                        "properties": {
                          "organizationId": {
                            "type": "string",
                            "maxLength": 128,
                            "pattern": "^org_[A-Za-z0-9_-]+$"
                          },
                          "projectId": {
                            "type": "string",
                            "pattern": "^prj_[a-f0-9]{32}$"
                          },
                          "goalId": {
                            "type": "string",
                            "pattern": "^thr_[a-f0-9]{32}$"
                          }
                        },
                        "required": [
                          "organizationId",
                          "projectId",
                          "goalId"
                        ],
                        "additionalProperties": false
                      },
                      "claim": {
                        "type": "object",
                        "properties": {
                          "schemaVersion": {
                            "type": "string",
                            "const": "dancer-goals/v1"
                          },
                          "projectId": {
                            "type": "string",
                            "pattern": "^prj_[a-f0-9]{32}$"
                          },
                          "workRef": {
                            "type": "object",
                            "properties": {
                              "provider": {
                                "type": "string",
                                "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                              },
                              "id": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 160
                              },
                              "label": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80
                              },
                              "url": {
                                "type": "string",
                                "maxLength": 2048,
                                "format": "uri"
                              }
                            },
                            "required": [
                              "provider",
                              "id"
                            ],
                            "additionalProperties": false
                          },
                          "ownerId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^agt_[a-z0-9]{16,64}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "revision": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "updatedAtMs": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "schemaVersion",
                          "projectId",
                          "workRef",
                          "ownerId",
                          "revision",
                          "updatedAtMs"
                        ],
                        "additionalProperties": false
                      },
                      "receipt": {
                        "type": "object",
                        "properties": {
                          "operationId": {
                            "type": "string",
                            "pattern": "^gop_[a-f0-9]{32}$"
                          },
                          "committedAtMs": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "revision": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "replayed": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "operationId",
                          "committedAtMs",
                          "revision",
                          "replayed"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "schemaVersion",
                      "ok",
                      "scope",
                      "claim",
                      "receipt"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "schemaVersion": {
                        "type": "string",
                        "const": "dancer-goals/v1"
                      },
                      "ok": {
                        "type": "boolean",
                        "const": true
                      },
                      "scope": {
                        "type": "object",
                        "properties": {
                          "organizationId": {
                            "type": "string",
                            "maxLength": 128,
                            "pattern": "^org_[A-Za-z0-9_-]+$"
                          },
                          "projectId": {
                            "type": "string",
                            "pattern": "^prj_[a-f0-9]{32}$"
                          },
                          "goalId": {
                            "type": "string",
                            "pattern": "^thr_[a-f0-9]{32}$"
                          }
                        },
                        "required": [
                          "organizationId",
                          "projectId",
                          "goalId"
                        ],
                        "additionalProperties": false
                      },
                      "report": {
                        "type": "object",
                        "properties": {
                          "reportId": {
                            "type": "string",
                            "pattern": "^gci_[a-f0-9]{32}$"
                          },
                          "goalId": {
                            "type": "string",
                            "pattern": "^thr_[a-f0-9]{32}$"
                          },
                          "projectId": {
                            "type": "string",
                            "pattern": "^prj_[a-f0-9]{32}$"
                          },
                          "workRef": {
                            "type": "object",
                            "properties": {
                              "provider": {
                                "type": "string",
                                "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                              },
                              "id": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 160
                              },
                              "label": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80
                              },
                              "url": {
                                "type": "string",
                                "maxLength": 2048,
                                "format": "uri"
                              }
                            },
                            "required": [
                              "provider",
                              "id"
                            ],
                            "additionalProperties": false
                          },
                          "ownerRevision": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "authorId": {
                            "type": "string",
                            "pattern": "^agt_[a-z0-9]{16,64}$"
                          },
                          "createdAtMs": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "working",
                              "blocked",
                              "waiting",
                              "done"
                            ]
                          },
                          "summary": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 2000
                          },
                          "nextAction": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 1000
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "evidence": {
                            "maxItems": 16,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "maxLength": 2048,
                              "format": "uri"
                            }
                          },
                          "blockedRequestId": {
                            "type": "string",
                            "pattern": "^rpl_[a-f0-9]{32}$"
                          }
                        },
                        "required": [
                          "reportId",
                          "goalId",
                          "projectId",
                          "workRef",
                          "ownerRevision",
                          "authorId",
                          "createdAtMs",
                          "state",
                          "summary",
                          "nextAction",
                          "evidence"
                        ],
                        "additionalProperties": false
                      },
                      "receipt": {
                        "type": "object",
                        "properties": {
                          "operationId": {
                            "type": "string",
                            "pattern": "^gop_[a-f0-9]{32}$"
                          },
                          "committedAtMs": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "revision": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "replayed": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "operationId",
                          "committedAtMs",
                          "revision",
                          "replayed"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "schemaVersion",
                      "ok",
                      "scope",
                      "report",
                      "receipt"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "schemaVersion",
              "ok",
              "scope",
              "status",
              "result"
            ],
            "additionalProperties": false
          }
        ]
      }
    },
    "goals.create": {
      "method": "POST",
      "path": "/v1/messages/projects/{projectId}/goals",
      "action": "goals.create",
      "mutation": true,
      "request": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "operation": {
            "type": "string",
            "const": "goals.create"
          },
          "projectId": {
            "type": "string",
            "pattern": "^prj_[a-f0-9]{32}$"
          },
          "input": {
            "type": "object",
            "properties": {
              "operationKey": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 140
              },
              "outcome": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "externalReference": {
                "type": "string",
                "maxLength": 2048,
                "format": "uri"
              },
              "work": {
                "default": [],
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "provider": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 160
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "url": {
                      "type": "string",
                      "maxLength": 2048,
                      "format": "uri"
                    }
                  },
                  "required": [
                    "provider",
                    "id"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "operationKey",
              "title",
              "outcome",
              "work"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "operation",
          "projectId",
          "input"
        ],
        "additionalProperties": false
      },
      "response": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "dancer-goals/v1"
          },
          "ok": {
            "type": "boolean",
            "const": true
          },
          "scope": {
            "type": "object",
            "properties": {
              "organizationId": {
                "type": "string",
                "maxLength": 128,
                "pattern": "^org_[A-Za-z0-9_-]+$"
              },
              "projectId": {
                "type": "string",
                "pattern": "^prj_[a-f0-9]{32}$"
              },
              "goalId": {
                "type": "string",
                "pattern": "^thr_[a-f0-9]{32}$"
              }
            },
            "required": [
              "organizationId",
              "projectId",
              "goalId"
            ],
            "additionalProperties": false
          },
          "goal": {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "type": "string",
                "const": "dancer-goals/v1"
              },
              "organizationId": {
                "type": "string",
                "maxLength": 128,
                "pattern": "^org_[A-Za-z0-9_-]+$"
              },
              "projectId": {
                "type": "string",
                "pattern": "^prj_[a-f0-9]{32}$"
              },
              "goalId": {
                "type": "string",
                "pattern": "^thr_[a-f0-9]{32}$"
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 140
              },
              "outcome": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "externalReference": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "managerId": {
                "type": "string",
                "pattern": "^agt_[a-z0-9]{16,64}$"
              },
              "state": {
                "type": "string",
                "enum": [
                  "active",
                  "paused",
                  "closed"
                ]
              },
              "revision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "createdAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "updatedAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "schemaVersion",
              "organizationId",
              "projectId",
              "goalId",
              "title",
              "outcome",
              "externalReference",
              "managerId",
              "state",
              "revision",
              "createdAtMs",
              "updatedAtMs"
            ],
            "additionalProperties": false
          },
          "receipt": {
            "type": "object",
            "properties": {
              "operationId": {
                "type": "string",
                "pattern": "^gop_[a-f0-9]{32}$"
              },
              "committedAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "revision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "operationId",
              "committedAtMs",
              "revision",
              "replayed"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "schemaVersion",
          "ok",
          "scope",
          "goal",
          "receipt"
        ],
        "additionalProperties": false
      }
    },
    "goals.list": {
      "method": "GET",
      "path": "/v1/messages/projects/{projectId}/goals",
      "action": "goals.read",
      "mutation": false,
      "request": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "operation": {
            "type": "string",
            "const": "goals.list"
          },
          "projectId": {
            "type": "string",
            "pattern": "^prj_[a-f0-9]{32}$"
          },
          "input": {
            "type": "object",
            "properties": {
              "cursor": {
                "type": "string",
                "maxLength": 2048
              },
              "limit": {
                "default": 20,
                "type": "integer",
                "minimum": 1,
                "maximum": 50
              }
            },
            "required": [
              "limit"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "operation",
          "projectId",
          "input"
        ],
        "additionalProperties": false
      },
      "response": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "dancer-goals/v1"
          },
          "ok": {
            "type": "boolean",
            "const": true
          },
          "scope": {
            "type": "object",
            "properties": {
              "organizationId": {
                "type": "string",
                "maxLength": 128,
                "pattern": "^org_[A-Za-z0-9_-]+$"
              },
              "projectId": {
                "type": "string",
                "pattern": "^prj_[a-f0-9]{32}$"
              }
            },
            "required": [
              "organizationId",
              "projectId"
            ],
            "additionalProperties": false
          },
          "page": {
            "type": "object",
            "properties": {
              "items": {
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "schemaVersion": {
                      "type": "string",
                      "const": "dancer-goals/v1"
                    },
                    "organizationId": {
                      "type": "string",
                      "maxLength": 128,
                      "pattern": "^org_[A-Za-z0-9_-]+$"
                    },
                    "projectId": {
                      "type": "string",
                      "pattern": "^prj_[a-f0-9]{32}$"
                    },
                    "goalId": {
                      "type": "string",
                      "pattern": "^thr_[a-f0-9]{32}$"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 140
                    },
                    "outcome": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2000
                    },
                    "externalReference": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 2048,
                          "format": "uri"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "managerId": {
                      "type": "string",
                      "pattern": "^agt_[a-z0-9]{16,64}$"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "active",
                        "paused",
                        "closed"
                      ]
                    },
                    "revision": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "createdAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "updatedAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "schemaVersion",
                    "organizationId",
                    "projectId",
                    "goalId",
                    "title",
                    "outcome",
                    "externalReference",
                    "managerId",
                    "state",
                    "revision",
                    "createdAtMs",
                    "updatedAtMs"
                  ],
                  "additionalProperties": false
                }
              },
              "cursor": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "items",
              "cursor"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "schemaVersion",
          "ok",
          "scope",
          "page"
        ],
        "additionalProperties": false
      }
    },
    "goals.get": {
      "method": "GET",
      "path": "/v1/messages/projects/{projectId}/goals/{goalId}",
      "action": "goals.read",
      "mutation": false,
      "request": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "operation": {
            "type": "string",
            "const": "goals.get"
          },
          "projectId": {
            "type": "string",
            "pattern": "^prj_[a-f0-9]{32}$"
          },
          "goalId": {
            "type": "string",
            "pattern": "^thr_[a-f0-9]{32}$"
          },
          "input": {
            "type": "object",
            "properties": {
              "cursor": {
                "type": "string",
                "maxLength": 2048
              },
              "limit": {
                "default": 20,
                "type": "integer",
                "minimum": 1,
                "maximum": 50
              },
              "view": {
                "default": "briefing",
                "type": "string",
                "enum": [
                  "briefing",
                  "activity",
                  "requests",
                  "inbox"
                ]
              },
              "activityCursor": {
                "type": "string",
                "maxLength": 2048
              },
              "requestCursor": {
                "type": "string",
                "maxLength": 2048
              },
              "inboxCursor": {
                "type": "string",
                "maxLength": 2048
              }
            },
            "required": [
              "limit",
              "view"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "operation",
          "projectId",
          "goalId",
          "input"
        ],
        "additionalProperties": false
      },
      "response": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "type": "string",
                "const": "dancer-goals/v1"
              },
              "ok": {
                "type": "boolean",
                "const": true
              },
              "scope": {
                "type": "object",
                "properties": {
                  "organizationId": {
                    "type": "string",
                    "maxLength": 128,
                    "pattern": "^org_[A-Za-z0-9_-]+$"
                  },
                  "projectId": {
                    "type": "string",
                    "pattern": "^prj_[a-f0-9]{32}$"
                  },
                  "goalId": {
                    "type": "string",
                    "pattern": "^thr_[a-f0-9]{32}$"
                  }
                },
                "required": [
                  "organizationId",
                  "projectId",
                  "goalId"
                ],
                "additionalProperties": false
              },
              "view": {
                "default": "briefing",
                "type": "string",
                "const": "briefing"
              },
              "goal": {
                "type": "object",
                "properties": {
                  "schemaVersion": {
                    "type": "string",
                    "const": "dancer-goals/v1"
                  },
                  "organizationId": {
                    "type": "string",
                    "maxLength": 128,
                    "pattern": "^org_[A-Za-z0-9_-]+$"
                  },
                  "projectId": {
                    "type": "string",
                    "pattern": "^prj_[a-f0-9]{32}$"
                  },
                  "goalId": {
                    "type": "string",
                    "pattern": "^thr_[a-f0-9]{32}$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 140
                  },
                  "outcome": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "externalReference": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2048,
                        "format": "uri"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "managerId": {
                    "type": "string",
                    "pattern": "^agt_[a-z0-9]{16,64}$"
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "active",
                      "paused",
                      "closed"
                    ]
                  },
                  "revision": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "createdAtMs": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "updatedAtMs": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "schemaVersion",
                  "organizationId",
                  "projectId",
                  "goalId",
                  "title",
                  "outcome",
                  "externalReference",
                  "managerId",
                  "state",
                  "revision",
                  "createdAtMs",
                  "updatedAtMs"
                ],
                "additionalProperties": false
              },
              "work": {
                "type": "object",
                "properties": {
                  "items": {
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "workRef": {
                          "type": "object",
                          "properties": {
                            "provider": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                            },
                            "id": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 160
                            },
                            "label": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "url": {
                              "type": "string",
                              "maxLength": 2048,
                              "format": "uri"
                            }
                          },
                          "required": [
                            "provider",
                            "id"
                          ],
                          "additionalProperties": false
                        },
                        "claim": {
                          "type": "object",
                          "properties": {
                            "schemaVersion": {
                              "type": "string",
                              "const": "dancer-goals/v1"
                            },
                            "projectId": {
                              "type": "string",
                              "pattern": "^prj_[a-f0-9]{32}$"
                            },
                            "ownerId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^agt_[a-z0-9]{16,64}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "revision": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "updatedAtMs": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "schemaVersion",
                            "projectId",
                            "ownerId",
                            "revision",
                            "updatedAtMs"
                          ],
                          "additionalProperties": false
                        },
                        "latestReport": {
                          "default": null,
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "reportId": {
                                  "type": "string",
                                  "pattern": "^gci_[a-f0-9]{32}$"
                                },
                                "ownerRevision": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "authorId": {
                                  "type": "string",
                                  "pattern": "^agt_[a-z0-9]{16,64}$"
                                },
                                "createdAtMs": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "state": {
                                  "type": "string",
                                  "enum": [
                                    "working",
                                    "blocked",
                                    "waiting",
                                    "done"
                                  ]
                                },
                                "blockedRequestId": {
                                  "type": "string",
                                  "pattern": "^rpl_[a-f0-9]{32}$"
                                },
                                "summaryPreview": {
                                  "type": "string",
                                  "maxLength": 256
                                },
                                "nextActionPreview": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "maxLength": 256
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "summaryTruncated": {
                                  "type": "boolean"
                                },
                                "nextActionTruncated": {
                                  "type": "boolean"
                                },
                                "evidence": {
                                  "maxItems": 1,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "maxLength": 2048,
                                    "format": "uri"
                                  }
                                },
                                "evidenceCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 16
                                },
                                "evidenceTruncated": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "reportId",
                                "ownerRevision",
                                "authorId",
                                "createdAtMs",
                                "state",
                                "summaryPreview",
                                "nextActionPreview",
                                "summaryTruncated",
                                "nextActionTruncated",
                                "evidence",
                                "evidenceCount",
                                "evidenceTruncated"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "workRef",
                        "claim",
                        "latestReport"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "cursor": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "items",
                  "cursor"
                ],
                "additionalProperties": false
              },
              "requests": {
                "default": {
                  "items": [],
                  "cursor": null,
                  "hasMore": false
                },
                "type": "object",
                "properties": {
                  "items": {
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "messageId": {
                          "type": "string",
                          "pattern": "^msg_[a-f0-9]{32}$"
                        },
                        "senderId": {
                          "type": "string",
                          "pattern": "^agt_[a-z0-9]{16,64}$"
                        },
                        "recipientId": {
                          "type": "string",
                          "pattern": "^agt_[a-z0-9]{16,64}$"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "replyMessageId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^msg_[a-f0-9]{32}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "replyState": {
                          "type": "string",
                          "enum": [
                            "awaiting_reply",
                            "replied"
                          ]
                        }
                      },
                      "required": [
                        "messageId",
                        "senderId",
                        "recipientId",
                        "createdAt",
                        "replyMessageId",
                        "replyState"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "cursor": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "hasMore": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "items",
                  "cursor",
                  "hasMore"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "schemaVersion",
              "ok",
              "scope",
              "view",
              "goal",
              "work",
              "requests"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "type": "string",
                "const": "dancer-goals/v1"
              },
              "ok": {
                "type": "boolean",
                "const": true
              },
              "scope": {
                "type": "object",
                "properties": {
                  "organizationId": {
                    "type": "string",
                    "maxLength": 128,
                    "pattern": "^org_[A-Za-z0-9_-]+$"
                  },
                  "projectId": {
                    "type": "string",
                    "pattern": "^prj_[a-f0-9]{32}$"
                  },
                  "goalId": {
                    "type": "string",
                    "pattern": "^thr_[a-f0-9]{32}$"
                  }
                },
                "required": [
                  "organizationId",
                  "projectId",
                  "goalId"
                ],
                "additionalProperties": false
              },
              "view": {
                "type": "string",
                "const": "activity"
              },
              "activity": {
                "type": "object",
                "properties": {
                  "items": {
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "message": {},
                        "goal": {
                          "anyOf": [
                            {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "report_projection"
                                    },
                                    "reportId": {
                                      "type": "string",
                                      "pattern": "^gci_[a-f0-9]{32}$"
                                    },
                                    "workRef": {
                                      "type": "object",
                                      "properties": {
                                        "provider": {
                                          "type": "string",
                                          "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                                        },
                                        "id": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 160
                                        },
                                        "label": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 80
                                        },
                                        "url": {
                                          "type": "string",
                                          "maxLength": 2048,
                                          "format": "uri"
                                        }
                                      },
                                      "required": [
                                        "provider",
                                        "id"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "reportId"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "discussion"
                                    },
                                    "workRef": {
                                      "type": "object",
                                      "properties": {
                                        "provider": {
                                          "type": "string",
                                          "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                                        },
                                        "id": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 160
                                        },
                                        "label": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 80
                                        },
                                        "url": {
                                          "type": "string",
                                          "maxLength": 2048,
                                          "format": "uri"
                                        }
                                      },
                                      "required": [
                                        "provider",
                                        "id"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "goal"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "cursor": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "hasMore": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "items",
                  "cursor",
                  "hasMore"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "schemaVersion",
              "ok",
              "scope",
              "view",
              "activity"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "type": "string",
                "const": "dancer-goals/v1"
              },
              "ok": {
                "type": "boolean",
                "const": true
              },
              "scope": {
                "type": "object",
                "properties": {
                  "organizationId": {
                    "type": "string",
                    "maxLength": 128,
                    "pattern": "^org_[A-Za-z0-9_-]+$"
                  },
                  "projectId": {
                    "type": "string",
                    "pattern": "^prj_[a-f0-9]{32}$"
                  },
                  "goalId": {
                    "type": "string",
                    "pattern": "^thr_[a-f0-9]{32}$"
                  }
                },
                "required": [
                  "organizationId",
                  "projectId",
                  "goalId"
                ],
                "additionalProperties": false
              },
              "view": {
                "type": "string",
                "const": "requests"
              },
              "requests": {
                "type": "object",
                "properties": {
                  "items": {
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "messageId": {
                          "type": "string",
                          "pattern": "^msg_[a-f0-9]{32}$"
                        },
                        "senderId": {
                          "type": "string",
                          "pattern": "^agt_[a-z0-9]{16,64}$"
                        },
                        "recipientId": {
                          "type": "string",
                          "pattern": "^agt_[a-z0-9]{16,64}$"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "replyMessageId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^msg_[a-f0-9]{32}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "replyState": {
                          "type": "string",
                          "enum": [
                            "awaiting_reply",
                            "replied"
                          ]
                        }
                      },
                      "required": [
                        "messageId",
                        "senderId",
                        "recipientId",
                        "createdAt",
                        "replyMessageId",
                        "replyState"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "cursor": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "hasMore": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "items",
                  "cursor",
                  "hasMore"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "schemaVersion",
              "ok",
              "scope",
              "view",
              "requests"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "type": "string",
                "const": "dancer-goals/v1"
              },
              "ok": {
                "type": "boolean",
                "const": true
              },
              "scope": {
                "type": "object",
                "properties": {
                  "organizationId": {
                    "type": "string",
                    "maxLength": 128,
                    "pattern": "^org_[A-Za-z0-9_-]+$"
                  },
                  "projectId": {
                    "type": "string",
                    "pattern": "^prj_[a-f0-9]{32}$"
                  },
                  "goalId": {
                    "type": "string",
                    "pattern": "^thr_[a-f0-9]{32}$"
                  }
                },
                "required": [
                  "organizationId",
                  "projectId",
                  "goalId"
                ],
                "additionalProperties": false
              },
              "view": {
                "type": "string",
                "const": "inbox"
              },
              "inbox": {
                "type": "object",
                "properties": {
                  "items": {
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "reportId": {
                          "type": "string",
                          "pattern": "^gci_[a-f0-9]{32}$"
                        },
                        "messageId": {
                          "type": "string",
                          "pattern": "^msg_[a-f0-9]{32}$"
                        },
                        "goalId": {
                          "type": "string",
                          "pattern": "^thr_[a-f0-9]{32}$"
                        },
                        "createdAtMs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "reportId",
                        "messageId",
                        "goalId",
                        "createdAtMs"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "cursor": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "hasMore": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "items",
                  "cursor",
                  "hasMore"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "schemaVersion",
              "ok",
              "scope",
              "view",
              "inbox"
            ],
            "additionalProperties": false
          }
        ]
      }
    },
    "goals.update": {
      "method": "PATCH",
      "path": "/v1/messages/projects/{projectId}/goals/{goalId}",
      "action": "goals.update",
      "mutation": true,
      "request": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "operation": {
            "type": "string",
            "const": "goals.update"
          },
          "projectId": {
            "type": "string",
            "pattern": "^prj_[a-f0-9]{32}$"
          },
          "goalId": {
            "type": "string",
            "pattern": "^thr_[a-f0-9]{32}$"
          },
          "input": {
            "type": "object",
            "properties": {
              "operationKey": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "Current goal.revision for this metadata update."
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 140
              },
              "outcome": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "externalReference": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "managerId": {
                "type": "string",
                "pattern": "^agt_[a-z0-9]{16,64}$"
              },
              "state": {
                "type": "string",
                "enum": [
                  "active",
                  "paused",
                  "closed"
                ]
              },
              "attach": {
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "provider": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 160
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "url": {
                      "type": "string",
                      "maxLength": 2048,
                      "format": "uri"
                    }
                  },
                  "required": [
                    "provider",
                    "id"
                  ],
                  "additionalProperties": false
                }
              },
              "detach": {
                "maxItems": 32,
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 160
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "url": {
                          "type": "string",
                          "maxLength": 2048,
                          "format": "uri"
                        }
                      },
                      "required": [
                        "provider",
                        "id"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        }
                      },
                      "required": [
                        "provider",
                        "label"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            },
            "required": [
              "operationKey",
              "expectedRevision"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "operation",
          "projectId",
          "goalId",
          "input"
        ],
        "additionalProperties": false
      },
      "response": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "dancer-goals/v1"
          },
          "ok": {
            "type": "boolean",
            "const": true
          },
          "scope": {
            "type": "object",
            "properties": {
              "organizationId": {
                "type": "string",
                "maxLength": 128,
                "pattern": "^org_[A-Za-z0-9_-]+$"
              },
              "projectId": {
                "type": "string",
                "pattern": "^prj_[a-f0-9]{32}$"
              },
              "goalId": {
                "type": "string",
                "pattern": "^thr_[a-f0-9]{32}$"
              }
            },
            "required": [
              "organizationId",
              "projectId",
              "goalId"
            ],
            "additionalProperties": false
          },
          "goal": {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "type": "string",
                "const": "dancer-goals/v1"
              },
              "organizationId": {
                "type": "string",
                "maxLength": 128,
                "pattern": "^org_[A-Za-z0-9_-]+$"
              },
              "projectId": {
                "type": "string",
                "pattern": "^prj_[a-f0-9]{32}$"
              },
              "goalId": {
                "type": "string",
                "pattern": "^thr_[a-f0-9]{32}$"
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 140
              },
              "outcome": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "externalReference": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "managerId": {
                "type": "string",
                "pattern": "^agt_[a-z0-9]{16,64}$"
              },
              "state": {
                "type": "string",
                "enum": [
                  "active",
                  "paused",
                  "closed"
                ]
              },
              "revision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "createdAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "updatedAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "schemaVersion",
              "organizationId",
              "projectId",
              "goalId",
              "title",
              "outcome",
              "externalReference",
              "managerId",
              "state",
              "revision",
              "createdAtMs",
              "updatedAtMs"
            ],
            "additionalProperties": false
          },
          "receipt": {
            "type": "object",
            "properties": {
              "operationId": {
                "type": "string",
                "pattern": "^gop_[a-f0-9]{32}$"
              },
              "committedAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "revision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "operationId",
              "committedAtMs",
              "revision",
              "replayed"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "schemaVersion",
          "ok",
          "scope",
          "goal",
          "receipt"
        ],
        "additionalProperties": false
      }
    },
    "goals.check_in": {
      "method": "POST",
      "path": "/v1/messages/projects/{projectId}/goals/{goalId}/check-ins",
      "action": "work.report",
      "mutation": true,
      "request": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "operation": {
            "type": "string",
            "const": "goals.check_in"
          },
          "projectId": {
            "type": "string",
            "pattern": "^prj_[a-f0-9]{32}$"
          },
          "goalId": {
            "type": "string",
            "pattern": "^thr_[a-f0-9]{32}$"
          },
          "input": {
            "type": "object",
            "properties": {
              "operationKey": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
              },
              "workRef": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "provider": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "label": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "url": {
                        "type": "string",
                        "maxLength": 2048,
                        "format": "uri"
                      }
                    },
                    "required": [
                      "provider",
                      "id"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "provider": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                      },
                      "label": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      }
                    },
                    "required": [
                      "provider",
                      "label"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "Current work.items[].claim.revision; zero before the first claim."
              },
              "state": {
                "type": "string",
                "enum": [
                  "working",
                  "blocked",
                  "waiting",
                  "done"
                ]
              },
              "summary": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "nextAction": {
                "default": null,
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "evidence": {
                "default": [],
                "maxItems": 16,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 2048,
                  "format": "uri"
                }
              },
              "blockedRequestId": {
                "type": "string",
                "pattern": "^rpl_[a-f0-9]{32}$"
              }
            },
            "required": [
              "operationKey",
              "workRef",
              "expectedRevision",
              "state",
              "summary",
              "nextAction",
              "evidence"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "operation",
          "projectId",
          "goalId",
          "input"
        ],
        "additionalProperties": false
      },
      "response": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "dancer-goals/v1"
          },
          "ok": {
            "type": "boolean",
            "const": true
          },
          "scope": {
            "type": "object",
            "properties": {
              "organizationId": {
                "type": "string",
                "maxLength": 128,
                "pattern": "^org_[A-Za-z0-9_-]+$"
              },
              "projectId": {
                "type": "string",
                "pattern": "^prj_[a-f0-9]{32}$"
              },
              "goalId": {
                "type": "string",
                "pattern": "^thr_[a-f0-9]{32}$"
              }
            },
            "required": [
              "organizationId",
              "projectId",
              "goalId"
            ],
            "additionalProperties": false
          },
          "report": {
            "type": "object",
            "properties": {
              "reportId": {
                "type": "string",
                "pattern": "^gci_[a-f0-9]{32}$"
              },
              "goalId": {
                "type": "string",
                "pattern": "^thr_[a-f0-9]{32}$"
              },
              "projectId": {
                "type": "string",
                "pattern": "^prj_[a-f0-9]{32}$"
              },
              "workRef": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "url": {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  }
                },
                "required": [
                  "provider",
                  "id"
                ],
                "additionalProperties": false
              },
              "ownerRevision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "authorId": {
                "type": "string",
                "pattern": "^agt_[a-z0-9]{16,64}$"
              },
              "createdAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "state": {
                "type": "string",
                "enum": [
                  "working",
                  "blocked",
                  "waiting",
                  "done"
                ]
              },
              "summary": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "nextAction": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "evidence": {
                "maxItems": 16,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 2048,
                  "format": "uri"
                }
              },
              "blockedRequestId": {
                "type": "string",
                "pattern": "^rpl_[a-f0-9]{32}$"
              }
            },
            "required": [
              "reportId",
              "goalId",
              "projectId",
              "workRef",
              "ownerRevision",
              "authorId",
              "createdAtMs",
              "state",
              "summary",
              "nextAction",
              "evidence"
            ],
            "additionalProperties": false
          },
          "receipt": {
            "type": "object",
            "properties": {
              "operationId": {
                "type": "string",
                "pattern": "^gop_[a-f0-9]{32}$"
              },
              "committedAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "revision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "operationId",
              "committedAtMs",
              "revision",
              "replayed"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "schemaVersion",
          "ok",
          "scope",
          "report",
          "receipt"
        ],
        "additionalProperties": false
      }
    },
    "goals.report.get": {
      "method": "GET",
      "path": "/v1/messages/projects/{projectId}/goals/{goalId}/check-ins/{reportId}",
      "action": "goals.read",
      "mutation": false,
      "request": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "operation": {
            "type": "string",
            "const": "goals.report.get"
          },
          "projectId": {
            "type": "string",
            "pattern": "^prj_[a-f0-9]{32}$"
          },
          "goalId": {
            "type": "string",
            "pattern": "^thr_[a-f0-9]{32}$"
          },
          "reportId": {
            "type": "string",
            "pattern": "^gci_[a-f0-9]{32}$"
          },
          "input": {
            "type": "object",
            "properties": {},
            "additionalProperties": false
          }
        },
        "required": [
          "operation",
          "projectId",
          "goalId",
          "reportId",
          "input"
        ],
        "additionalProperties": false
      },
      "response": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "dancer-goals/v1"
          },
          "ok": {
            "type": "boolean",
            "const": true
          },
          "scope": {
            "type": "object",
            "properties": {
              "organizationId": {
                "type": "string",
                "maxLength": 128,
                "pattern": "^org_[A-Za-z0-9_-]+$"
              },
              "projectId": {
                "type": "string",
                "pattern": "^prj_[a-f0-9]{32}$"
              },
              "goalId": {
                "type": "string",
                "pattern": "^thr_[a-f0-9]{32}$"
              }
            },
            "required": [
              "organizationId",
              "projectId",
              "goalId"
            ],
            "additionalProperties": false
          },
          "report": {
            "type": "object",
            "properties": {
              "reportId": {
                "type": "string",
                "pattern": "^gci_[a-f0-9]{32}$"
              },
              "goalId": {
                "type": "string",
                "pattern": "^thr_[a-f0-9]{32}$"
              },
              "projectId": {
                "type": "string",
                "pattern": "^prj_[a-f0-9]{32}$"
              },
              "workRef": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "url": {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  }
                },
                "required": [
                  "provider",
                  "id"
                ],
                "additionalProperties": false
              },
              "ownerRevision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "authorId": {
                "type": "string",
                "pattern": "^agt_[a-z0-9]{16,64}$"
              },
              "createdAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "state": {
                "type": "string",
                "enum": [
                  "working",
                  "blocked",
                  "waiting",
                  "done"
                ]
              },
              "summary": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "nextAction": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "evidence": {
                "maxItems": 16,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 2048,
                  "format": "uri"
                }
              },
              "blockedRequestId": {
                "type": "string",
                "pattern": "^rpl_[a-f0-9]{32}$"
              }
            },
            "required": [
              "reportId",
              "goalId",
              "projectId",
              "workRef",
              "ownerRevision",
              "authorId",
              "createdAtMs",
              "state",
              "summary",
              "nextAction",
              "evidence"
            ],
            "additionalProperties": false
          },
          "publication": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "thread": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "published"
                    ]
                  },
                  "inbox": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "published",
                      "skipped"
                    ]
                  },
                  "inboxReferencesPublished": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "inboxReferencesSkipped": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "lastError": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "publication_unavailable"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "thread",
                  "inbox",
                  "inboxReferencesPublished",
                  "inboxReferencesSkipped",
                  "lastError"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "schemaVersion",
          "ok",
          "scope",
          "report",
          "publication"
        ],
        "additionalProperties": false
      }
    },
    "goals.claim": {
      "method": "POST",
      "path": "/v1/messages/projects/{projectId}/goals/{goalId}/claims",
      "action": "work.claim",
      "mutation": true,
      "request": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "operation": {
            "type": "string",
            "const": "goals.claim"
          },
          "projectId": {
            "type": "string",
            "pattern": "^prj_[a-f0-9]{32}$"
          },
          "goalId": {
            "type": "string",
            "pattern": "^thr_[a-f0-9]{32}$"
          },
          "input": {
            "type": "object",
            "properties": {
              "operationKey": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
              },
              "workRef": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "provider": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "label": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "url": {
                        "type": "string",
                        "maxLength": 2048,
                        "format": "uri"
                      }
                    },
                    "required": [
                      "provider",
                      "id"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "provider": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                      },
                      "label": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      }
                    },
                    "required": [
                      "provider",
                      "label"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "Current work.items[].claim.revision; zero before the first claim."
              }
            },
            "required": [
              "operationKey",
              "workRef",
              "expectedRevision"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "operation",
          "projectId",
          "goalId",
          "input"
        ],
        "additionalProperties": false
      },
      "response": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "dancer-goals/v1"
          },
          "ok": {
            "type": "boolean",
            "const": true
          },
          "scope": {
            "type": "object",
            "properties": {
              "organizationId": {
                "type": "string",
                "maxLength": 128,
                "pattern": "^org_[A-Za-z0-9_-]+$"
              },
              "projectId": {
                "type": "string",
                "pattern": "^prj_[a-f0-9]{32}$"
              },
              "goalId": {
                "type": "string",
                "pattern": "^thr_[a-f0-9]{32}$"
              }
            },
            "required": [
              "organizationId",
              "projectId",
              "goalId"
            ],
            "additionalProperties": false
          },
          "claim": {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "type": "string",
                "const": "dancer-goals/v1"
              },
              "projectId": {
                "type": "string",
                "pattern": "^prj_[a-f0-9]{32}$"
              },
              "workRef": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "url": {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  }
                },
                "required": [
                  "provider",
                  "id"
                ],
                "additionalProperties": false
              },
              "ownerId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^agt_[a-z0-9]{16,64}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "revision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "updatedAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "schemaVersion",
              "projectId",
              "workRef",
              "ownerId",
              "revision",
              "updatedAtMs"
            ],
            "additionalProperties": false
          },
          "receipt": {
            "type": "object",
            "properties": {
              "operationId": {
                "type": "string",
                "pattern": "^gop_[a-f0-9]{32}$"
              },
              "committedAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "revision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "operationId",
              "committedAtMs",
              "revision",
              "replayed"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "schemaVersion",
          "ok",
          "scope",
          "claim",
          "receipt"
        ],
        "additionalProperties": false
      }
    },
    "goals.transfer": {
      "method": "POST",
      "path": "/v1/messages/projects/{projectId}/goals/{goalId}/transfers",
      "action": "work.transfer",
      "mutation": true,
      "request": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "operation": {
            "type": "string",
            "const": "goals.transfer"
          },
          "projectId": {
            "type": "string",
            "pattern": "^prj_[a-f0-9]{32}$"
          },
          "goalId": {
            "type": "string",
            "pattern": "^thr_[a-f0-9]{32}$"
          },
          "input": {
            "type": "object",
            "properties": {
              "operationKey": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
              },
              "workRef": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "provider": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "label": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "url": {
                        "type": "string",
                        "maxLength": 2048,
                        "format": "uri"
                      }
                    },
                    "required": [
                      "provider",
                      "id"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "provider": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                      },
                      "label": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      }
                    },
                    "required": [
                      "provider",
                      "label"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "Current work.items[].claim.revision; zero before the first claim."
              },
              "to": {
                "type": "string",
                "pattern": "^agt_[a-z0-9]{16,64}$"
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1000
              }
            },
            "required": [
              "operationKey",
              "workRef",
              "expectedRevision",
              "to",
              "reason"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "operation",
          "projectId",
          "goalId",
          "input"
        ],
        "additionalProperties": false
      },
      "response": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "dancer-goals/v1"
          },
          "ok": {
            "type": "boolean",
            "const": true
          },
          "scope": {
            "type": "object",
            "properties": {
              "organizationId": {
                "type": "string",
                "maxLength": 128,
                "pattern": "^org_[A-Za-z0-9_-]+$"
              },
              "projectId": {
                "type": "string",
                "pattern": "^prj_[a-f0-9]{32}$"
              },
              "goalId": {
                "type": "string",
                "pattern": "^thr_[a-f0-9]{32}$"
              }
            },
            "required": [
              "organizationId",
              "projectId",
              "goalId"
            ],
            "additionalProperties": false
          },
          "claim": {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "type": "string",
                "const": "dancer-goals/v1"
              },
              "projectId": {
                "type": "string",
                "pattern": "^prj_[a-f0-9]{32}$"
              },
              "workRef": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "url": {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  }
                },
                "required": [
                  "provider",
                  "id"
                ],
                "additionalProperties": false
              },
              "ownerId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^agt_[a-z0-9]{16,64}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "revision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "updatedAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "schemaVersion",
              "projectId",
              "workRef",
              "ownerId",
              "revision",
              "updatedAtMs"
            ],
            "additionalProperties": false
          },
          "receipt": {
            "type": "object",
            "properties": {
              "operationId": {
                "type": "string",
                "pattern": "^gop_[a-f0-9]{32}$"
              },
              "committedAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "revision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "operationId",
              "committedAtMs",
              "revision",
              "replayed"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "schemaVersion",
          "ok",
          "scope",
          "claim",
          "receipt"
        ],
        "additionalProperties": false
      }
    },
    "goals.release": {
      "method": "POST",
      "path": "/v1/messages/projects/{projectId}/goals/{goalId}/releases",
      "action": "work.release",
      "mutation": true,
      "request": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "operation": {
            "type": "string",
            "const": "goals.release"
          },
          "projectId": {
            "type": "string",
            "pattern": "^prj_[a-f0-9]{32}$"
          },
          "goalId": {
            "type": "string",
            "pattern": "^thr_[a-f0-9]{32}$"
          },
          "input": {
            "type": "object",
            "properties": {
              "operationKey": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
              },
              "workRef": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "provider": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "label": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "url": {
                        "type": "string",
                        "maxLength": 2048,
                        "format": "uri"
                      }
                    },
                    "required": [
                      "provider",
                      "id"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "provider": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                      },
                      "label": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      }
                    },
                    "required": [
                      "provider",
                      "label"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "Current work.items[].claim.revision; zero before the first claim."
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1000
              }
            },
            "required": [
              "operationKey",
              "workRef",
              "expectedRevision",
              "reason"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "operation",
          "projectId",
          "goalId",
          "input"
        ],
        "additionalProperties": false
      },
      "response": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "dancer-goals/v1"
          },
          "ok": {
            "type": "boolean",
            "const": true
          },
          "scope": {
            "type": "object",
            "properties": {
              "organizationId": {
                "type": "string",
                "maxLength": 128,
                "pattern": "^org_[A-Za-z0-9_-]+$"
              },
              "projectId": {
                "type": "string",
                "pattern": "^prj_[a-f0-9]{32}$"
              },
              "goalId": {
                "type": "string",
                "pattern": "^thr_[a-f0-9]{32}$"
              }
            },
            "required": [
              "organizationId",
              "projectId",
              "goalId"
            ],
            "additionalProperties": false
          },
          "claim": {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "type": "string",
                "const": "dancer-goals/v1"
              },
              "projectId": {
                "type": "string",
                "pattern": "^prj_[a-f0-9]{32}$"
              },
              "workRef": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "url": {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  }
                },
                "required": [
                  "provider",
                  "id"
                ],
                "additionalProperties": false
              },
              "ownerId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^agt_[a-z0-9]{16,64}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "revision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "updatedAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "schemaVersion",
              "projectId",
              "workRef",
              "ownerId",
              "revision",
              "updatedAtMs"
            ],
            "additionalProperties": false
          },
          "receipt": {
            "type": "object",
            "properties": {
              "operationId": {
                "type": "string",
                "pattern": "^gop_[a-f0-9]{32}$"
              },
              "committedAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "revision": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "operationId",
              "committedAtMs",
              "revision",
              "replayed"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "schemaVersion",
          "ok",
          "scope",
          "claim",
          "receipt"
        ],
        "additionalProperties": false
      }
    }
  },
  "schemas": {
    "goal": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "string",
          "const": "dancer-goals/v1"
        },
        "organizationId": {
          "type": "string",
          "maxLength": 128,
          "pattern": "^org_[A-Za-z0-9_-]+$"
        },
        "projectId": {
          "type": "string",
          "pattern": "^prj_[a-f0-9]{32}$"
        },
        "goalId": {
          "type": "string",
          "pattern": "^thr_[a-f0-9]{32}$"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 140
        },
        "outcome": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "externalReference": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048,
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        },
        "managerId": {
          "type": "string",
          "pattern": "^agt_[a-z0-9]{16,64}$"
        },
        "state": {
          "type": "string",
          "enum": [
            "active",
            "paused",
            "closed"
          ]
        },
        "revision": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "schemaVersion",
        "organizationId",
        "projectId",
        "goalId",
        "title",
        "outcome",
        "externalReference",
        "managerId",
        "state",
        "revision",
        "createdAtMs",
        "updatedAtMs"
      ],
      "additionalProperties": false
    },
    "work": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "provider": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
        },
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 160
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "url": {
          "type": "string",
          "maxLength": 2048,
          "format": "uri"
        }
      },
      "required": [
        "provider",
        "id"
      ],
      "additionalProperties": false
    },
    "claim": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "string",
          "const": "dancer-goals/v1"
        },
        "projectId": {
          "type": "string",
          "pattern": "^prj_[a-f0-9]{32}$"
        },
        "workRef": {
          "type": "object",
          "properties": {
            "provider": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
            },
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 160
            },
            "label": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            },
            "url": {
              "type": "string",
              "maxLength": 2048,
              "format": "uri"
            }
          },
          "required": [
            "provider",
            "id"
          ],
          "additionalProperties": false
        },
        "ownerId": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^agt_[a-z0-9]{16,64}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "revision": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "schemaVersion",
        "projectId",
        "workRef",
        "ownerId",
        "revision",
        "updatedAtMs"
      ],
      "additionalProperties": false
    },
    "report": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "reportId": {
          "type": "string",
          "pattern": "^gci_[a-f0-9]{32}$"
        },
        "goalId": {
          "type": "string",
          "pattern": "^thr_[a-f0-9]{32}$"
        },
        "projectId": {
          "type": "string",
          "pattern": "^prj_[a-f0-9]{32}$"
        },
        "workRef": {
          "type": "object",
          "properties": {
            "provider": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_.-]{0,39}$"
            },
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 160
            },
            "label": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            },
            "url": {
              "type": "string",
              "maxLength": 2048,
              "format": "uri"
            }
          },
          "required": [
            "provider",
            "id"
          ],
          "additionalProperties": false
        },
        "ownerRevision": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "authorId": {
          "type": "string",
          "pattern": "^agt_[a-z0-9]{16,64}$"
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "state": {
          "type": "string",
          "enum": [
            "working",
            "blocked",
            "waiting",
            "done"
          ]
        },
        "summary": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "nextAction": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 1000
            },
            {
              "type": "null"
            }
          ]
        },
        "evidence": {
          "maxItems": 16,
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          }
        },
        "blockedRequestId": {
          "type": "string",
          "pattern": "^rpl_[a-f0-9]{32}$"
        }
      },
      "required": [
        "reportId",
        "goalId",
        "projectId",
        "workRef",
        "ownerRevision",
        "authorId",
        "createdAtMs",
        "state",
        "summary",
        "nextAction",
        "evidence"
      ],
      "additionalProperties": false
    },
    "reportSummary": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "reportId": {
          "type": "string",
          "pattern": "^gci_[a-f0-9]{32}$"
        },
        "ownerRevision": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "authorId": {
          "type": "string",
          "pattern": "^agt_[a-z0-9]{16,64}$"
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "state": {
          "type": "string",
          "enum": [
            "working",
            "blocked",
            "waiting",
            "done"
          ]
        },
        "blockedRequestId": {
          "type": "string",
          "pattern": "^rpl_[a-f0-9]{32}$"
        },
        "summaryPreview": {
          "type": "string",
          "maxLength": 256
        },
        "nextActionPreview": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 256
            },
            {
              "type": "null"
            }
          ]
        },
        "summaryTruncated": {
          "type": "boolean"
        },
        "nextActionTruncated": {
          "type": "boolean"
        },
        "evidence": {
          "maxItems": 1,
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          }
        },
        "evidenceCount": {
          "type": "integer",
          "minimum": 0,
          "maximum": 16
        },
        "evidenceTruncated": {
          "type": "boolean"
        }
      },
      "required": [
        "reportId",
        "ownerRevision",
        "authorId",
        "createdAtMs",
        "state",
        "summaryPreview",
        "nextActionPreview",
        "summaryTruncated",
        "nextActionTruncated",
        "evidence",
        "evidenceCount",
        "evidenceTruncated"
      ],
      "additionalProperties": false
    },
    "publication": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "thread": {
          "type": "string",
          "enum": [
            "pending",
            "published"
          ]
        },
        "inbox": {
          "type": "string",
          "enum": [
            "pending",
            "published",
            "skipped"
          ]
        },
        "inboxReferencesPublished": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "inboxReferencesSkipped": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "lastError": {
          "anyOf": [
            {
              "type": "string",
              "const": "publication_unavailable"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "thread",
        "inbox",
        "inboxReferencesPublished",
        "inboxReferencesSkipped",
        "lastError"
      ],
      "additionalProperties": false
    },
    "permission": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "enum": [
            "goals.create",
            "goals.read",
            "goals.update",
            "work.claim",
            "work.report",
            "work.transfer",
            "work.release"
          ]
        },
        "resource": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "messages.project_goals"
                },
                "organizationId": {
                  "type": "string",
                  "maxLength": 128,
                  "pattern": "^org_[A-Za-z0-9_-]+$"
                },
                "projectId": {
                  "type": "string",
                  "pattern": "^prj_[a-f0-9]{32}$"
                }
              },
              "required": [
                "kind",
                "organizationId",
                "projectId"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "messages.goal"
                },
                "organizationId": {
                  "type": "string",
                  "maxLength": 128,
                  "pattern": "^org_[A-Za-z0-9_-]+$"
                },
                "projectId": {
                  "type": "string",
                  "pattern": "^prj_[a-f0-9]{32}$"
                },
                "goalId": {
                  "type": "string",
                  "pattern": "^thr_[a-f0-9]{32}$"
                }
              },
              "required": [
                "kind",
                "organizationId",
                "projectId",
                "goalId"
              ],
              "additionalProperties": false
            }
          ]
        }
      },
      "required": [
        "action",
        "resource"
      ],
      "additionalProperties": false
    },
    "receipt": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "operationId": {
          "type": "string",
          "pattern": "^gop_[a-f0-9]{32}$"
        },
        "committedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "revision": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "replayed": {
          "type": "boolean"
        }
      },
      "required": [
        "operationId",
        "committedAtMs",
        "revision",
        "replayed"
      ],
      "additionalProperties": false
    },
    "error": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "string",
          "const": "dancer-goals/v1"
        },
        "ok": {
          "type": "boolean",
          "const": false
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string",
              "enum": [
                "invalid_request",
                "unauthorized",
                "permission_denied",
                "goal_not_found",
                "wrong_project_type",
                "work_not_attached",
                "ambiguous_work_reference",
                "ownership_conflict",
                "stale_revision",
                "operation_conflict",
                "goal_closed",
                "outcome_unknown",
                "unavailable"
              ]
            },
            "message": {
              "type": "string",
              "maxLength": 512
            },
            "retryable": {
              "type": "boolean"
            },
            "nextOperations": {
              "maxItems": 8,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 256
              }
            },
            "currentRevision": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "code",
            "message",
            "retryable",
            "nextOperations"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "schemaVersion",
        "ok",
        "error"
      ],
      "additionalProperties": false
    }
  }
}
