{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hootlens-com/json-schema/hootlens-com-finding-work-schema.json",
  "title": "FindingWork",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hootlens-com-openapi.json#/components/schemas/FindingWork",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^finding_[0-9a-f]{64}$"
    },
    "projectId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "source": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "element"
            },
            "context": {
              "type": "object",
              "properties": {
                "pageGroup": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "version": {
                  "type": "string",
                  "maxLength": 200
                },
                "release": {
                  "type": "string",
                  "maxLength": 100
                },
                "revision": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 150
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "variant": {
                  "type": "string",
                  "maxLength": 100
                },
                "variantScope": {
                  "type": "string",
                  "enum": [
                    "single",
                    "pooled",
                    "unknown"
                  ]
                },
                "deviceClass": {
                  "type": "string",
                  "enum": [
                    "desktop",
                    "tablet",
                    "mobile",
                    "unknown"
                  ]
                },
                "locale": {
                  "type": "string",
                  "maxLength": 100
                }
              },
              "required": [
                "pageGroup",
                "version",
                "revision",
                "variant",
                "variantScope",
                "deviceClass"
              ],
              "additionalProperties": false
            },
            "cohortKey": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2000
            },
            "selector": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            }
          },
          "required": [
            "kind",
            "context",
            "cohortKey",
            "selector"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "javascript-error"
            },
            "context": {
              "type": "object",
              "properties": {
                "pageGroup": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "version": {
                  "type": "string",
                  "maxLength": 200
                },
                "release": {
                  "type": "string",
                  "maxLength": 100
                },
                "revision": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 150
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "variant": {
                  "type": "string",
                  "maxLength": 100
                },
                "variantScope": {
                  "type": "string",
                  "enum": [
                    "single",
                    "pooled",
                    "unknown"
                  ]
                },
                "deviceClass": {
                  "type": "string",
                  "enum": [
                    "desktop",
                    "tablet",
                    "mobile",
                    "unknown"
                  ]
                },
                "locale": {
                  "type": "string",
                  "maxLength": 100
                }
              },
              "required": [
                "pageGroup",
                "version",
                "revision",
                "variant",
                "variantScope",
                "deviceClass"
              ],
              "additionalProperties": false
            },
            "fingerprint": {
              "type": "string",
              "pattern": "^[0-9a-f]{16}$"
            }
          },
          "required": [
            "kind",
            "context",
            "fingerprint"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "funnel-dropoff"
            },
            "context": {
              "type": "object",
              "properties": {
                "pageGroup": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "version": {
                  "type": "string",
                  "maxLength": 200
                },
                "release": {
                  "type": "string",
                  "maxLength": 100
                },
                "revision": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 150
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "variant": {
                  "type": "string",
                  "maxLength": 100
                },
                "variantScope": {
                  "type": "string",
                  "enum": [
                    "single",
                    "pooled",
                    "unknown"
                  ]
                },
                "deviceClass": {
                  "type": "string",
                  "enum": [
                    "desktop",
                    "tablet",
                    "mobile",
                    "unknown"
                  ]
                },
                "locale": {
                  "type": "string",
                  "maxLength": 100
                }
              },
              "required": [
                "pageGroup",
                "version",
                "revision",
                "variant",
                "variantScope",
                "deviceClass"
              ],
              "additionalProperties": false
            },
            "funnelId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "stepGoalId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "nextGoalId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "goalDefinitions": {
              "minItems": 2,
              "maxItems": 8,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "since": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "id",
                  "since"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "kind",
            "context",
            "funnelId",
            "stepGoalId",
            "nextGoalId",
            "goalDefinitions"
          ],
          "additionalProperties": false
        }
      ]
    },
    "revision": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "status": {
      "type": "string",
      "enum": [
        "open",
        "in_progress",
        "snoozed",
        "dismissed",
        "fixed"
      ]
    },
    "assigneeId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "snoozedUntil": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "reason": {
      "type": "string",
      "maxLength": 500
    },
    "githubUrl": {
      "type": "string",
      "maxLength": 500
    },
    "changeId": {
      "type": "string",
      "maxLength": 200
    },
    "createdAt": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "updatedAt": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "history": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "at": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "actorId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "action": {
            "type": "string",
            "enum": [
              "start",
              "reopen",
              "assign",
              "snooze",
              "dismiss",
              "linkGithub",
              "linkChange",
              "deploy"
            ]
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "in_progress",
              "snoozed",
              "dismissed",
              "fixed"
            ]
          },
          "assigneeId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "until": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "reason": {
            "type": "string",
            "maxLength": 500
          },
          "githubUrl": {
            "type": "string",
            "maxLength": 500
          },
          "changeId": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "at",
          "actorId",
          "action",
          "revision",
          "status"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "id",
    "projectId",
    "source",
    "revision",
    "status",
    "createdAt",
    "updatedAt",
    "history"
  ],
  "additionalProperties": false
}