{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "status",
    "candidateId",
    "company",
    "role",
    "url",
    "reportNum",
    "score",
    "sessionId",
    "sessionsOpened",
    "schemaCalls",
    "runActionsTransactions",
    "runActionsContinuations",
    "submitActionCount",
    "otpConfirmationActions",
    "submissionAttempted",
    "gmailChecked",
    "confirmation",
    "trackerTsv",
    "receipt",
    "ownSessionDisconnected",
    "notes",
    "error"
  ],
  "properties": {
    "status": {
      "type": "string",
      "enum": ["APPLIED", "APPLY FAILED", "SKIP", "Discarded"]
    },
    "candidateId": { "type": "string" },
    "company": { "type": "string" },
    "role": { "type": "string" },
    "url": { "type": "string" },
    "reportNum": { "type": "string" },
    "score": { "type": "string" },
    "sessionId": { "type": ["string", "null"] },
    "sessionsOpened": { "type": "integer", "minimum": 0, "maximum": 1 },
    "schemaCalls": { "type": "integer", "minimum": 0, "maximum": 1, "description": "Number of dispatched geometra_form_schema calls." },
    "runActionsTransactions": { "type": "integer", "minimum": 0, "maximum": 1, "description": "One after the immutable base geometra_run_actions transaction is dispatched, even if it stops before Submit." },
    "runActionsContinuations": { "type": "integer", "minimum": 0, "maximum": 1, "description": "Number of authorized soft-timeout continuations of the same immutable transaction." },
    "submitActionCount": { "type": "integer", "minimum": 0, "maximum": 1, "description": "One when final Submit executed or cannot be ruled out; zero only with parsed proof that execution stopped before final Submit." },
    "otpConfirmationActions": { "type": "integer", "minimum": 0, "maximum": 1 },
    "submissionAttempted": { "type": "boolean", "description": "Fail closed: true when final Submit executed or cannot be ruled out after transaction dispatch; false only with parsed step proof that execution stopped before final Submit." },
    "gmailChecked": { "type": "boolean" },
    "confirmation": {
      "type": "object",
      "additionalProperties": false,
      "required": ["state", "source", "evidence"],
      "properties": {
        "state": {
          "type": "string",
          "enum": ["confirmed", "not-submitted", "ambiguous", "not-applicable"]
        },
        "source": {
          "type": "string",
          "enum": ["portal", "gmail", "portal-and-gmail", "none"]
        },
        "evidence": { "type": "string" }
      }
    },
    "trackerTsv": { "type": ["string", "null"] },
    "receipt": { "type": ["string", "null"] },
    "ownSessionDisconnected": {
      "type": "boolean",
      "description": "True only when the one opened Geometra session was explicitly disconnected; false when no session opened or cleanup failed."
    },
    "notes": { "type": "string" },
    "error": { "type": ["string", "null"] }
  }
}
