{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {
    "Limits": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "attachments_per_turn": {
          "const": 4
        },
        "image_bytes": {
          "const": 8388608
        },
        "image_longest_side": {
          "const": 6000
        },
        "image_pixels": {
          "const": 36000000
        },
        "text_bytes": {
          "const": 65536
        },
        "upload_lifetime_seconds": {
          "const": 2592000
        },
        "upload_body_bytes": {
          "const": 11201196
        },
        "assembled_image_bytes": {
          "const": 33554432
        },
        "retained_uploads_per_learner": {
          "const": 32
        },
        "learner_storage_bytes": {
          "const": 67108864
        },
        "workspace_storage_bytes": {
          "const": 268435456
        },
        "uploads_per_learner_day": {
          "const": 100
        }
      },
      "required": [
        "attachments_per_turn",
        "image_bytes",
        "image_longest_side",
        "image_pixels",
        "text_bytes",
        "upload_lifetime_seconds",
        "upload_body_bytes",
        "assembled_image_bytes",
        "retained_uploads_per_learner",
        "learner_storage_bytes",
        "workspace_storage_bytes",
        "uploads_per_learner_day"
      ]
    },
    "Catalog": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.quest.catalog.v1"
        },
        "interface_version": {
          "const": "2026-12-01"
        },
        "postures": {
          "type": "array",
          "items": {
            "enum": [
              "guided",
              "feedback",
              "explain",
              "diagnostic"
            ]
          },
          "maxItems": 4,
          "minItems": 3,
          "uniqueItems": true
        },
        "requested_support": {
          "type": "array",
          "items": {
            "enum": [
              "auto",
              "hint",
              "framework",
              "example",
              "coaching"
            ]
          },
          "maxItems": 5,
          "minItems": 5,
          "uniqueItems": true
        },
        "media_types": {
          "type": "array",
          "items": {
            "enum": [
              "image/png",
              "image/jpeg",
              "image/webp",
              "text/plain",
              "text/markdown"
            ]
          },
          "maxItems": 5,
          "minItems": 5,
          "uniqueItems": true
        },
        "limits": {
          "$ref": "#/$defs/Limits"
        },
        "write_policy": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "profile": {
              "type": "boolean"
            },
            "long_term": {
              "type": "boolean"
            }
          },
          "required": [
            "profile",
            "long_term"
          ]
        },
        "release_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "rate_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "content_release": {
          "type": "string",
          "maxLength": 100
        },
        "mode": {
          "enum": [
            "test",
            "live"
          ]
        },
        "price": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount_micro_usd": {
              "type": "integer",
              "minimum": 0
            },
            "currency": {
              "const": "USD"
            },
            "unit": {
              "const": "governed_turn"
            }
          },
          "required": [
            "amount_micro_usd",
            "currency",
            "unit"
          ]
        },
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "required": [
        "schema",
        "interface_version",
        "postures",
        "requested_support",
        "media_types",
        "limits",
        "write_policy",
        "release_id",
        "rate_id",
        "content_release",
        "mode",
        "price"
      ]
    },
    "Task": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "enum": [
            "homework",
            "practice",
            "exam_prep",
            "open"
          ]
        },
        "subject": {
          "type": "string",
          "maxLength": 120
        },
        "assignment": {
          "type": "string",
          "maxLength": 2000
        }
      },
      "required": [
        "kind"
      ]
    },
    "LearnerPreferences": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "preferred_name": {
          "type": "string",
          "maxLength": 80
        },
        "grade_band": {
          "enum": [
            "primary",
            "middle",
            "9-10",
            "11-12",
            "higher_education",
            "adult",
            "unspecified"
          ]
        },
        "language": {
          "enum": [
            "en"
          ]
        },
        "reading_level": {
          "enum": [
            "on_grade",
            "simplified",
            "unspecified"
          ]
        },
        "support_needs": {
          "enum": [
            "none",
            "step_by_step",
            "plain_language",
            "unspecified"
          ]
        }
      },
      "required": []
    },
    "Setup": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "task": {
          "$ref": "#/$defs/Task"
        },
        "learner": {
          "anyOf": [
            {
              "$ref": "#/$defs/LearnerPreferences"
            },
            {
              "type": "null"
            }
          ]
        },
        "display_name": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 80
            },
            {
              "type": "null"
            }
          ]
        },
        "team_dialog": {
          "type": "boolean"
        },
        "posture": {
          "enum": [
            "guided",
            "feedback",
            "explain",
            "diagnostic"
          ]
        },
        "assessment": {
          "$ref": "#/$defs/AssessmentInput"
        }
      },
      "required": [
        "task"
      ]
    },
    "CreateSession": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "setup": {
          "$ref": "#/$defs/Setup"
        }
      },
      "required": [
        "setup"
      ]
    },
    "Upload": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "media_type": {
          "enum": [
            "image/png",
            "image/jpeg",
            "image/webp",
            "text/plain",
            "text/markdown"
          ]
        },
        "data": {
          "type": "string",
          "minLength": 4,
          "maxLength": 11184812
        },
        "filename": {
          "type": "string",
          "maxLength": 160
        },
        "session_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "required": [
        "media_type",
        "data"
      ]
    },
    "Attachment": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "attachment_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "media_type": {
          "enum": [
            "image/png",
            "image/jpeg",
            "image/webp",
            "text/plain",
            "text/markdown"
          ]
        },
        "bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 8388608
        },
        "created_at": {
          "type": "string",
          "minLength": 20,
          "maxLength": 35
        },
        "expires_at": {
          "type": "string",
          "minLength": 20,
          "maxLength": 35
        },
        "status": {
          "enum": [
            "pending",
            "available",
            "linked",
            "rejected",
            "expired",
            "deleted"
          ]
        },
        "session_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            {
              "type": "null"
            }
          ]
        },
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "required": [
        "attachment_id",
        "media_type",
        "bytes",
        "created_at",
        "expires_at",
        "status",
        "session_id"
      ]
    },
    "Source": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "session_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "committed_at": {
          "type": "string",
          "minLength": 20,
          "maxLength": 35
        }
      },
      "required": [
        "session_id",
        "request_id",
        "committed_at"
      ]
    },
    "Signal": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "concept": {
          "type": "string",
          "maxLength": 160
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 240
            },
            {
              "type": "null"
            }
          ]
        },
        "source": {
          "$ref": "#/$defs/Source"
        }
      },
      "required": [
        "concept",
        "evidence",
        "source"
      ]
    },
    "State": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.quest.state.v1"
        },
        "session_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "status": {
          "enum": [
            "available",
            "unavailable"
          ]
        },
        "source": {
          "anyOf": [
            {
              "$ref": "#/$defs/Source"
            },
            {
              "type": "null"
            }
          ]
        },
        "posture": {
          "anyOf": [
            {
              "enum": [
                "guided",
                "feedback",
                "explain",
                "diagnostic"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "effective_support": {
          "anyOf": [
            {
              "enum": [
                "baseline",
                "hints",
                "frameworks",
                "parallel_examples",
                "coaching"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "progress": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 400
            },
            {
              "type": "null"
            }
          ]
        },
        "observed_signals": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Signal"
          },
          "maxItems": 32
        },
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "required": [
        "schema",
        "session_id",
        "status",
        "source",
        "posture",
        "effective_support",
        "progress",
        "observed_signals"
      ]
    },
    "Summary": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.quest.summary.v1"
        },
        "session_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "status": {
          "enum": [
            "available",
            "unavailable"
          ]
        },
        "source": {
          "anyOf": [
            {
              "$ref": "#/$defs/Source"
            },
            {
              "type": "null"
            }
          ]
        },
        "text": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 32000
            },
            {
              "type": "null"
            }
          ]
        },
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "required": [
        "schema",
        "session_id",
        "status",
        "source",
        "text"
      ]
    },
    "SupportObservation": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "support": {
          "enum": [
            "baseline",
            "hints",
            "frameworks",
            "parallel_examples",
            "coaching"
          ]
        },
        "source": {
          "$ref": "#/$defs/Source"
        }
      },
      "required": [
        "support",
        "source"
      ]
    },
    "Profile": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.quest.profile.v1"
        },
        "user_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "seeded_preferences": {
          "anyOf": [
            {
              "$ref": "#/$defs/LearnerPreferences"
            },
            {
              "type": "null"
            }
          ]
        },
        "seed_source": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "session_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "created_at": {
                  "type": "string",
                  "minLength": 20,
                  "maxLength": 35
                }
              },
              "required": [
                "session_id",
                "created_at"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "observed_signals": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Signal"
          },
          "maxItems": 32
        },
        "support_history": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SupportObservation"
          },
          "maxItems": 32
        },
        "last_observed_at": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 20,
              "maxLength": 35
            },
            {
              "type": "null"
            }
          ]
        },
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "required": [
        "schema",
        "user_id",
        "seeded_preferences",
        "seed_source",
        "observed_signals",
        "support_history",
        "last_observed_at"
      ]
    },
    "Session": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.quest.session.v1"
        },
        "session_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "setup": {
          "$ref": "#/$defs/Setup"
        },
        "status": {
          "enum": [
            "prepared",
            "active",
            "closed",
            "discarded"
          ]
        },
        "created_at": {
          "type": "string",
          "minLength": 20,
          "maxLength": 35
        },
        "content_release": {
          "type": "string",
          "maxLength": 100
        },
        "release_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "rate_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "limits": {
          "$ref": "#/$defs/Limits"
        },
        "state": {
          "$ref": "#/$defs/State"
        },
        "summary": {
          "$ref": "#/$defs/Summary"
        },
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "required": [
        "schema",
        "session_id",
        "setup",
        "status",
        "created_at",
        "content_release",
        "release_id",
        "rate_id",
        "limits",
        "state",
        "summary"
      ]
    },
    "SessionList": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.quest.sessions.v1"
        },
        "sessions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Session"
          },
          "maxItems": 100
        },
        "next_cursor": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 1024
            },
            {
              "type": "null"
            }
          ]
        },
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "required": [
        "schema",
        "sessions",
        "next_cursor"
      ]
    },
    "Export": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "fl.quest.export.v1"
        },
        "sessions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Session"
          },
          "maxItems": 100
        },
        "profile": {
          "$ref": "#/$defs/Profile"
        },
        "attachments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Attachment"
          },
          "maxItems": 32
        },
        "next_cursor": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 1024
            },
            {
              "type": "null"
            }
          ]
        },
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "required": [
        "schema",
        "sessions",
        "profile",
        "attachments",
        "next_cursor"
      ]
    },
    "AttachmentDelete": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "attachment_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "status": {
          "enum": [
            "deleted"
          ]
        },
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "required": [
        "attachment_id",
        "status"
      ]
    },
    "AssessmentInput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema_version": {
          "const": "fl.quest.assessment-input.v1"
        },
        "goal": {
          "type": "string",
          "maxLength": 2000
        },
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "origin": {
                "enum": [
                  "submitted_work",
                  "teacher_reference",
                  "application_context"
                ]
              },
              "text": {
                "type": "string",
                "maxLength": 16000
              },
              "attachment_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "locator": {
                "type": "string",
                "maxLength": 400
              },
              "availability": {
                "enum": [
                  "available",
                  "missing",
                  "unreadable"
                ]
              }
            },
            "required": [
              "id",
              "origin",
              "text",
              "attachment_id",
              "locator",
              "availability"
            ]
          },
          "maxItems": 32
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "source_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "question": {
                "type": "string",
                "maxLength": 6000
              },
              "answer": {
                "type": "string",
                "maxLength": 6000
              },
              "work": {
                "type": "string",
                "maxLength": 6000
              },
              "supplied_mark": {
                "type": "string",
                "maxLength": 6000
              },
              "reference_answer": {
                "type": "string",
                "maxLength": 6000
              }
            },
            "required": [
              "id",
              "source_id",
              "question",
              "answer",
              "work",
              "supplied_mark",
              "reference_answer"
            ]
          },
          "maxItems": 30
        },
        "targets": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "reference": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "origin": {
                "type": "string",
                "maxLength": 400
              },
              "description": {
                "type": "string",
                "maxLength": 2000
              },
              "shared_skill_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "reference",
              "origin",
              "description",
              "shared_skill_id"
            ]
          },
          "maxItems": 32
        },
        "original_result": {
          "type": "string",
          "maxLength": 2000
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 2000
          },
          "maxItems": 32
        }
      },
      "required": [
        "schema_version",
        "goal",
        "sources",
        "items",
        "targets",
        "original_result",
        "limitations"
      ]
    },
    "AssessmentFinding": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        },
        "supersedes_revision": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "kind": {
          "enum": [
            "skill",
            "gap",
            "misconception",
            "unassessed"
          ]
        },
        "skill": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "provisional": {
              "type": "boolean"
            },
            "catalog_origin": {
              "type": "string",
              "maxLength": 400
            }
          },
          "required": [
            "id",
            "provisional",
            "catalog_origin"
          ]
        },
        "title": {
          "type": "string",
          "maxLength": 6000
        },
        "observation": {
          "type": "string",
          "maxLength": 6000
        },
        "interpretation": {
          "type": "string",
          "maxLength": 6000
        },
        "qualification": {
          "enum": [
            "supported",
            "provisional",
            "unresolved"
          ]
        },
        "evidence_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 64
        },
        "counterevidence_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 64
        },
        "assistance": {
          "type": "string",
          "maxLength": 6000
        },
        "lifecycle": {
          "enum": [
            "active",
            "weakened",
            "resolved",
            "superseded"
          ]
        },
        "limits": {
          "type": "string",
          "maxLength": 6000
        },
        "next_probe": {
          "type": "string",
          "maxLength": 6000
        }
      },
      "required": [
        "id",
        "revision",
        "supersedes_revision",
        "kind",
        "skill",
        "title",
        "observation",
        "interpretation",
        "qualification",
        "evidence_refs",
        "counterevidence_refs",
        "assistance",
        "lifecycle",
        "limits",
        "next_probe"
      ]
    },
    "AssessmentRecord": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema_version": {
          "const": "fl.quest.assessment.v1"
        },
        "selected_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 64
        },
        "probe_origin": {
          "enum": [
            "original_work",
            "generated_probe",
            "clarification",
            "none"
          ]
        },
        "probe_purpose": {
          "type": "string",
          "maxLength": 2000
        },
        "ready_to_finish": {
          "type": "boolean"
        },
        "findings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AssessmentFinding"
          },
          "maxItems": 16
        },
        "diagnosis": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "headline": {
                  "type": "string",
                  "maxLength": 2000
                },
                "interpretation": {
                  "type": "string",
                  "maxLength": 6000
                },
                "qualification": {
                  "enum": [
                    "supported",
                    "provisional",
                    "unresolved"
                  ]
                },
                "evidence_refs": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "maxItems": 64
                },
                "counterevidence_refs": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "maxItems": 64
                }
              },
              "required": [
                "headline",
                "interpretation",
                "qualification",
                "evidence_refs",
                "counterevidence_refs"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "coverage": {
          "type": "string",
          "maxLength": 6000
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 2000
          },
          "maxItems": 32
        },
        "unanswered_questions": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 2000
          },
          "maxItems": 32
        }
      },
      "required": [
        "schema_version",
        "selected_refs",
        "probe_origin",
        "probe_purpose",
        "ready_to_finish",
        "findings",
        "diagnosis",
        "coverage",
        "limitations",
        "unanswered_questions"
      ]
    },
    "AssessmentEvent": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "turn_index": {
          "type": "integer",
          "minimum": 0
        },
        "posture": {
          "enum": [
            "guided",
            "feedback",
            "explain",
            "diagnostic"
          ]
        },
        "operation": {
          "enum": [
            "opening",
            "turn",
            "closeout"
          ]
        },
        "source": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "session_id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "request_id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "committed_at": {
              "type": "string",
              "maxLength": 35
            }
          },
          "required": [
            "session_id",
            "request_id",
            "committed_at"
          ]
        },
        "provenance": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "content_release": {
              "type": "string",
              "maxLength": 100
            },
            "composition_hash": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64
            },
            "runtime_version": {
              "type": "string",
              "maxLength": 100
            }
          },
          "required": [
            "content_release",
            "composition_hash",
            "runtime_version"
          ]
        },
        "assessment": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "status": {
              "enum": [
                "complete",
                "in_progress",
                "incomplete"
              ]
            },
            "issues": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 2000
              },
              "maxItems": 32
            },
            "record": {
              "anyOf": [
                {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/AssessmentRecord"
                    },
                    {
                      "$ref": "#/$defs/AssessmentRecordV2"
                    }
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "status",
            "issues",
            "record"
          ]
        }
      },
      "required": [
        "event_id",
        "turn_index",
        "posture",
        "operation",
        "source",
        "provenance",
        "assessment"
      ]
    },
    "Assessment": {
      "type": "object",
      "anyOf": [
        {
          "$ref": "#/$defs/AssessmentLegacy"
        },
        {
          "$ref": "#/$defs/AssessmentLedgerReport"
        }
      ]
    },
    "AssessmentResult": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "evidence_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 64,
          "minItems": 1
        },
        "outcome": {
          "enum": [
            "correct",
            "incorrect",
            "indeterminate",
            "no_answer"
          ]
        },
        "judgment": {
          "type": "string",
          "maxLength": 6000,
          "minLength": 1
        },
        "assistance": {
          "type": "string",
          "maxLength": 6000,
          "minLength": 1
        },
        "method_evidence": {
          "type": "string",
          "maxLength": 6000,
          "minLength": 1
        },
        "limits": {
          "type": "string",
          "maxLength": 6000,
          "minLength": 1
        }
      },
      "required": [
        "evidence_refs",
        "outcome",
        "judgment",
        "assistance",
        "method_evidence",
        "limits"
      ]
    },
    "AssessmentRecordV2": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema_version": {
          "const": "fl.quest.assessment.v2"
        },
        "selected_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 64
        },
        "probe_origin": {
          "enum": [
            "original_work",
            "generated_probe",
            "clarification",
            "none"
          ]
        },
        "probe_purpose": {
          "type": "string",
          "maxLength": 2000
        },
        "ready_to_finish": {
          "type": "boolean"
        },
        "findings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AssessmentFinding"
          },
          "maxItems": 16
        },
        "diagnosis": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "headline": {
                  "type": "string",
                  "maxLength": 2000
                },
                "interpretation": {
                  "type": "string",
                  "maxLength": 6000
                },
                "qualification": {
                  "enum": [
                    "supported",
                    "provisional",
                    "unresolved"
                  ]
                },
                "evidence_refs": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "maxItems": 64
                },
                "counterevidence_refs": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "maxItems": 64
                }
              },
              "required": [
                "headline",
                "interpretation",
                "qualification",
                "evidence_refs",
                "counterevidence_refs"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "coverage": {
          "type": "string",
          "maxLength": 6000
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 2000
          },
          "maxItems": 32
        },
        "unanswered_questions": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 2000
          },
          "maxItems": 32
        },
        "result_evidence": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AssessmentResult"
          },
          "maxItems": 64
        }
      },
      "required": [
        "schema_version",
        "selected_refs",
        "probe_origin",
        "probe_purpose",
        "ready_to_finish",
        "findings",
        "diagnosis",
        "coverage",
        "limitations",
        "unanswered_questions",
        "result_evidence"
      ]
    },
    "AssessmentFindingUpdate": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "kind": {
          "enum": [
            "skill",
            "gap",
            "misconception",
            "unassessed"
          ]
        },
        "skill": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "provisional": {
              "type": "boolean"
            },
            "catalog_origin": {
              "type": "string",
              "maxLength": 400
            }
          },
          "required": []
        },
        "title": {
          "type": "string",
          "maxLength": 6000
        },
        "observation": {
          "type": "string",
          "maxLength": 6000
        },
        "interpretation": {
          "type": "string",
          "maxLength": 6000
        },
        "qualification": {
          "enum": [
            "supported",
            "provisional",
            "unresolved"
          ]
        },
        "evidence_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 64
        },
        "counterevidence_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 64
        },
        "assistance": {
          "type": "string",
          "maxLength": 6000
        },
        "lifecycle": {
          "enum": [
            "active",
            "weakened",
            "resolved",
            "superseded"
          ]
        },
        "limits": {
          "type": "string",
          "maxLength": 6000
        },
        "next_probe": {
          "type": "string",
          "maxLength": 6000
        }
      },
      "required": []
    },
    "AssessmentResultUpdate": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "evidence_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 64
        },
        "outcome": {
          "enum": [
            "correct",
            "incorrect",
            "indeterminate",
            "no_answer"
          ]
        },
        "judgment": {
          "type": "string",
          "maxLength": 6000,
          "minLength": 1
        },
        "assistance": {
          "type": "string",
          "maxLength": 6000,
          "minLength": 1
        },
        "method_evidence": {
          "type": "string",
          "maxLength": 6000,
          "minLength": 1
        },
        "limits": {
          "type": "string",
          "maxLength": 6000,
          "minLength": 1
        }
      },
      "required": []
    },
    "AssessmentFindingV3": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        },
        "supersedes_revision": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "kind": {
          "enum": [
            "skill",
            "gap",
            "misconception",
            "unassessed"
          ]
        },
        "skill": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "provisional": {
              "type": "boolean"
            },
            "catalog_origin": {
              "type": "string",
              "maxLength": 400
            }
          },
          "required": []
        },
        "title": {
          "type": "string",
          "maxLength": 6000
        },
        "observation": {
          "type": "string",
          "maxLength": 6000
        },
        "interpretation": {
          "type": "string",
          "maxLength": 6000
        },
        "qualification": {
          "enum": [
            "supported",
            "provisional",
            "unresolved"
          ]
        },
        "evidence_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 64
        },
        "counterevidence_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 64
        },
        "assistance": {
          "type": "string",
          "maxLength": 6000
        },
        "lifecycle": {
          "enum": [
            "active",
            "weakened",
            "resolved",
            "superseded"
          ]
        },
        "limits": {
          "type": "string",
          "maxLength": 6000
        },
        "next_probe": {
          "type": "string",
          "maxLength": 6000
        }
      },
      "required": [
        "id",
        "revision",
        "supersedes_revision"
      ]
    },
    "AssessmentResultV3": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        },
        "supersedes_revision": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "evidence_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 64
        },
        "outcome": {
          "enum": [
            "correct",
            "incorrect",
            "indeterminate",
            "no_answer"
          ]
        },
        "judgment": {
          "type": "string",
          "maxLength": 6000,
          "minLength": 1
        },
        "assistance": {
          "type": "string",
          "maxLength": 6000,
          "minLength": 1
        },
        "method_evidence": {
          "type": "string",
          "maxLength": 6000,
          "minLength": 1
        },
        "limits": {
          "type": "string",
          "maxLength": 6000,
          "minLength": 1
        }
      },
      "required": [
        "id",
        "revision",
        "supersedes_revision"
      ]
    },
    "AssessmentUpdate": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema_version": {
          "const": "fl.quest.assessment.v3"
        },
        "selected_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 64
        },
        "probe_origin": {
          "enum": [
            "original_work",
            "generated_probe",
            "clarification",
            "none"
          ]
        },
        "probe_purpose": {
          "type": "string",
          "maxLength": 2000
        },
        "ready_to_finish": {
          "type": "boolean"
        },
        "findings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AssessmentFindingUpdate"
          },
          "maxItems": 16
        },
        "diagnosis": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "headline": {
                  "type": "string",
                  "maxLength": 2000
                },
                "interpretation": {
                  "type": "string",
                  "maxLength": 6000
                },
                "qualification": {
                  "enum": [
                    "supported",
                    "provisional",
                    "unresolved"
                  ]
                },
                "evidence_refs": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "maxItems": 64
                },
                "counterevidence_refs": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "maxItems": 64
                }
              },
              "required": []
            },
            {
              "type": "null"
            }
          ]
        },
        "coverage": {
          "type": "string",
          "maxLength": 6000
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 2000
          },
          "maxItems": 32
        },
        "unanswered_questions": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 2000
          },
          "maxItems": 32
        },
        "result_evidence": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AssessmentResultUpdate"
          },
          "maxItems": 64
        }
      },
      "required": []
    },
    "AssessmentRecordV3": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema_version": {
          "const": "fl.quest.assessment.v3"
        },
        "selected_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 64
        },
        "probe_origin": {
          "enum": [
            "original_work",
            "generated_probe",
            "clarification",
            "none"
          ]
        },
        "probe_purpose": {
          "type": "string",
          "maxLength": 2000
        },
        "ready_to_finish": {
          "type": "boolean"
        },
        "findings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AssessmentFindingV3"
          },
          "maxItems": 16000
        },
        "diagnosis": {
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "headline": {
                  "type": "string",
                  "maxLength": 2000
                },
                "interpretation": {
                  "type": "string",
                  "maxLength": 6000
                },
                "qualification": {
                  "enum": [
                    "supported",
                    "provisional",
                    "unresolved"
                  ]
                },
                "evidence_refs": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "maxItems": 64
                },
                "counterevidence_refs": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "maxItems": 64
                }
              },
              "required": []
            },
            {
              "type": "null"
            }
          ]
        },
        "coverage": {
          "type": "string",
          "maxLength": 6000
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 2000
          },
          "maxItems": 32
        },
        "unanswered_questions": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 2000
          },
          "maxItems": 32
        },
        "result_evidence": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AssessmentResultV3"
          },
          "maxItems": 64000
        }
      },
      "required": [
        "schema_version"
      ]
    },
    "AssessmentLegacy": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema_version": {
          "const": "fl.quest.assessment.v1"
        },
        "session_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "release_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "rate_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "content_release": {
          "type": "string",
          "maxLength": 100
        },
        "input": {
          "anyOf": [
            {
              "$ref": "#/$defs/AssessmentInput"
            },
            {
              "type": "null"
            }
          ]
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AssessmentEvent"
          },
          "maxItems": 1000
        },
        "status": {
          "enum": [
            "complete",
            "in_progress",
            "incomplete"
          ]
        },
        "frozen": {
          "type": "boolean"
        },
        "original_result": {
          "type": "string",
          "maxLength": 2000
        },
        "evidence_digest": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64
        },
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "required": [
        "schema_version",
        "session_id",
        "release_id",
        "rate_id",
        "content_release",
        "input",
        "events",
        "status",
        "frozen",
        "original_result",
        "evidence_digest"
      ]
    },
    "AssessmentLedgerEvent": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "event_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "turn_index": {
          "type": "integer",
          "minimum": 0
        },
        "posture": {
          "enum": [
            "guided",
            "feedback",
            "explain",
            "diagnostic"
          ]
        },
        "operation": {
          "enum": [
            "opening",
            "turn",
            "closeout"
          ]
        },
        "source": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "session_id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "request_id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "committed_at": {
              "type": "string",
              "maxLength": 35
            }
          },
          "required": [
            "session_id",
            "request_id",
            "committed_at"
          ]
        },
        "provenance": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "content_release": {
              "type": "string",
              "maxLength": 100
            },
            "composition_hash": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64
            },
            "runtime_version": {
              "type": "string",
              "maxLength": 100
            }
          },
          "required": [
            "content_release",
            "composition_hash",
            "runtime_version"
          ]
        },
        "assessment": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "record": {
              "anyOf": [
                {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/AssessmentRecord"
                    },
                    {
                      "$ref": "#/$defs/AssessmentRecordV2"
                    },
                    {
                      "$ref": "#/$defs/AssessmentRecordV3"
                    }
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "record"
          ]
        }
      },
      "required": [
        "event_id",
        "turn_index",
        "posture",
        "operation",
        "source",
        "provenance",
        "assessment"
      ]
    },
    "AssessmentLedgerReport": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema_version": {
          "const": "fl.quest.assessment-report.v2"
        },
        "session_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "release_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "rate_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "content_release": {
          "type": "string",
          "maxLength": 100
        },
        "input": {
          "anyOf": [
            {
              "$ref": "#/$defs/AssessmentInput"
            },
            {
              "type": "null"
            }
          ]
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AssessmentLedgerEvent"
          },
          "maxItems": 1000
        },
        "frozen": {
          "type": "boolean"
        },
        "original_result": {
          "type": "string",
          "maxLength": 2000
        },
        "evidence_digest": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64
        },
        "state": {
          "enum": [
            "active",
            "closed"
          ]
        },
        "current": {
          "$ref": "#/$defs/AssessmentRecordV3"
        },
        "request_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "required": [
        "schema_version",
        "session_id",
        "release_id",
        "rate_id",
        "content_release",
        "input",
        "events",
        "frozen",
        "original_result",
        "evidence_digest",
        "state",
        "current"
      ]
    }
  },
  "$id": "https://developers.foreverlearning.ai/schemas/quest-v1.json",
  "title": "Learn developer API"
}
