{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bernstein-run/json-schema/bernstein-run-webhook-task-create-schema.json",
  "title": "WebhookTaskCreate",
  "description": "Body for POST /webhook.",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bernstein-run-openapi.yaml#/components/schemas/WebhookTaskCreate",
  "properties": {
    "id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1000
        },
        {
          "type": "null"
        }
      ],
      "title": "Id"
    },
    "title": {
      "type": "string",
      "maxLength": 500,
      "title": "Title"
    },
    "description": {
      "type": "string",
      "maxLength": 100000,
      "title": "Description"
    },
    "role": {
      "type": "string",
      "title": "Role",
      "default": "backend"
    },
    "tenant_id": {
      "type": "string",
      "maxLength": 1000,
      "title": "Tenant Id",
      "default": "default"
    },
    "priority": {
      "type": "integer",
      "title": "Priority",
      "default": 2
    },
    "scope": {
      "type": "string",
      "maxLength": 1000,
      "title": "Scope",
      "default": "medium"
    },
    "complexity": {
      "type": "string",
      "maxLength": 1000,
      "title": "Complexity",
      "default": "medium"
    },
    "eu_ai_act_risk": {
      "type": "string",
      "maxLength": 1000,
      "title": "Eu Ai Act Risk",
      "default": "minimal"
    },
    "approval_required": {
      "type": "boolean",
      "title": "Approval Required",
      "default": false
    },
    "risk_level": {
      "type": "string",
      "maxLength": 1000,
      "title": "Risk Level",
      "default": "low"
    },
    "estimated_minutes": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Estimated Minutes"
    },
    "depends_on": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "maxItems": 100,
      "title": "Depends On"
    },
    "parent_task_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1000
        },
        {
          "type": "null"
        }
      ],
      "title": "Parent Task Id"
    },
    "depends_on_repo": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 4096
        },
        {
          "type": "null"
        }
      ],
      "title": "Depends On Repo"
    },
    "owned_files": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "maxItems": 100,
      "title": "Owned Files"
    },
    "cell_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1000
        },
        {
          "type": "null"
        }
      ],
      "title": "Cell Id"
    },
    "repo": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 4096
        },
        {
          "type": "null"
        }
      ],
      "title": "Repo"
    },
    "task_type": {
      "type": "string",
      "maxLength": 1000,
      "title": "Task Type",
      "default": "standard"
    },
    "upgrade_details": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Upgrade Details"
    },
    "model": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1000
        },
        {
          "type": "null"
        }
      ],
      "title": "Model"
    },
    "effort": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1000
        },
        {
          "type": "null"
        }
      ],
      "title": "Effort"
    },
    "cli": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1000
        },
        {
          "type": "null"
        }
      ],
      "title": "Cli"
    },
    "batch_eligible": {
      "type": "boolean",
      "title": "Batch Eligible",
      "default": false
    },
    "completion_signals": {
      "items": {
        "$ref": "#/$defs/CompletionSignalSchema"
      },
      "type": "array",
      "maxItems": 100,
      "title": "Completion Signals"
    },
    "slack_context": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Slack Context"
    },
    "metadata": {
      "additionalProperties": true,
      "type": "object",
      "title": "Metadata"
    },
    "deadline": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Deadline"
    },
    "parent_session_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1000
        },
        {
          "type": "null"
        }
      ],
      "title": "Parent Session Id"
    },
    "parent_context": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 100000
        },
        {
          "type": "null"
        }
      ],
      "title": "Parent Context"
    },
    "retry_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Retry Count"
    },
    "max_retries": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Retries"
    },
    "retry_delay_s": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Retry Delay S"
    },
    "terminal_reason": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 100000
        },
        {
          "type": "null"
        }
      ],
      "title": "Terminal Reason"
    },
    "max_output_tokens": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Output Tokens"
    },
    "meta_messages": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 100
        },
        {
          "type": "null"
        }
      ],
      "title": "Meta Messages"
    },
    "max_turns": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 10000,
          "minimum": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Turns"
    },
    "artifact_spec": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Artifact Spec"
    }
  },
  "type": "object",
  "required": [
    "title",
    "description"
  ],
  "$defs": {
    "CompletionSignalSchema": {
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "path_exists",
            "glob_exists",
            "test_passes",
            "file_contains",
            "llm_review",
            "llm_judge"
          ],
          "title": "Type"
        },
        "value": {
          "type": "string",
          "title": "Value"
        }
      },
      "type": "object",
      "required": [
        "type",
        "value"
      ],
      "title": "CompletionSignalSchema",
      "description": "Pydantic schema for a single completion signal in API requests."
    }
  }
}