{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trajectory/json-schema/trajectory-aperture-grading-response-schema.json",
  "title": "ApertureGradingResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trajectory-aperture-api-openapi.yml#/components/schemas/ApertureGradingResponse",
  "properties": {
    "trajectory": {
      "anyOf": [
        {
          "$ref": "#/$defs/ApertureGradingTrajectory"
        },
        {
          "type": "null"
        }
      ]
    },
    "reward": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Reward"
    },
    "reward_sets": {
      "items": {
        "$ref": "#/$defs/ApertureRewardSet"
      },
      "type": "array",
      "title": "Reward Sets"
    },
    "executions": {
      "items": {
        "$ref": "#/$defs/ApertureGradingExecution"
      },
      "type": "array",
      "title": "Executions"
    },
    "warnings": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Warnings"
    },
    "referenceCriteria": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Referencecriteria"
    },
    "referenceRubricUri": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Referencerubricuri"
    },
    "verifiers": {
      "items": {
        "$ref": "#/$defs/ApertureVerifierConfig"
      },
      "type": "array",
      "title": "Verifiers"
    }
  },
  "type": "object",
  "required": [
    "trajectory",
    "warnings",
    "verifiers"
  ],
  "$defs": {
    "ApertureGraderBinding": {
      "properties": {
        "ref": {
          "type": "string",
          "title": "Ref"
        },
        "type": {
          "type": "string",
          "title": "Type"
        },
        "version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Version"
        },
        "entrypoint": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Entrypoint"
        },
        "artifact_uri": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Artifact Uri"
        },
        "solution_uri": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Solution Uri"
        },
        "config": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Config"
        },
        "reward_schema": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reward Schema"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "ref",
        "type"
      ],
      "title": "ApertureGraderBinding"
    },
    "ApertureGradingExecution": {
      "properties": {
        "operation_id": {
          "type": "string",
          "title": "Operation Id"
        },
        "grader_id": {
          "type": "string",
          "title": "Grader Id"
        },
        "state": {
          "type": "string",
          "title": "State"
        },
        "execution_trajectory_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Execution Trajectory Id"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "publication_completed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Publication Completed At"
        },
        "cleanup_completed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cleanup Completed At"
        },
        "diagnostic": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Diagnostic"
        }
      },
      "type": "object",
      "required": [
        "operation_id",
        "grader_id",
        "state",
        "execution_trajectory_id",
        "created_at",
        "publication_completed_at",
        "cleanup_completed_at",
        "diagnostic"
      ],
      "title": "ApertureGradingExecution"
    },
    "ApertureGradingReferenceTrajectory": {
      "properties": {
        "task": {
          "anyOf": [
            {
              "$ref": "#/$defs/ApertureXidTask"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Task"
        },
        "reward": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reward"
        },
        "steps": {
          "items": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "type": "array",
          "title": "Steps"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "steps"
      ],
      "title": "ApertureGradingReferenceTrajectory"
    },
    "ApertureGradingTrajectory": {
      "properties": {
        "steps": {
          "items": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "type": "array",
          "title": "Steps"
        },
        "step_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Step Count"
        },
        "total_reward": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Total Reward"
        },
        "reference_trajectory": {
          "anyOf": [
            {
              "$ref": "#/$defs/ApertureGradingReferenceTrajectory"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "steps"
      ],
      "title": "ApertureGradingTrajectory",
      "description": "A saved grading document, or an empty trajectory carrying only the reference."
    },
    "ApertureRewardSet": {
      "properties": {
        "grader_id": {
          "type": "string",
          "title": "Grader Id"
        },
        "reward": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reward"
        },
        "provenance": {
          "additionalProperties": true,
          "type": "object",
          "title": "Provenance"
        }
      },
      "type": "object",
      "required": [
        "grader_id",
        "reward",
        "provenance"
      ],
      "title": "ApertureRewardSet"
    },
    "ApertureVerifierConfig": {
      "properties": {
        "binding": {
          "$ref": "#/$defs/ApertureGraderBinding"
        },
        "config": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Config"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error"
        }
      },
      "type": "object",
      "required": [
        "binding",
        "config"
      ],
      "title": "ApertureVerifierConfig"
    },
    "ApertureXidTask": {
      "properties": {
        "id": {
          "title": "Id"
        },
        "task_id": {
          "title": "Task Id"
        },
        "instruction": {
          "title": "Instruction"
        },
        "question": {
          "title": "Question"
        },
        "title": {
          "title": "Title"
        },
        "type": {
          "title": "Type"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "title": "ApertureXidTask"
    }
  }
}