{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://traittune.com/.well-known/profile-schema.json",
  "title": "TraitTune Profile Export",
  "description": "Portable personality profile exported by TraitTune at the profile owner's request. Interpretive layer only: a per-dimension 0-100 position with a confidence percentage. Latent psychometric parameters are never exported. Agents should accept additional unknown fields gracefully.",
  "type": "object",
  "required": ["schema", "generated_at", "language", "profile"],
  "properties": {
    "schema": {
      "type": "string",
      "const": "traittune.psydna.v1",
      "description": "Contract identifier. Bumped before any breaking change."
    },
    "generated_at": {
      "type": "string",
      "format": "date-time",
      "description": "RFC 3339 timestamp of export generation."
    },
    "language": {
      "type": "string",
      "enum": ["en", "ru", "es", "fr"],
      "description": "Language the human-readable fields (name, microtype, short_blurb) are rendered in."
    },
    "profile": {
      "type": "object",
      "required": ["dimensions"],
      "properties": {
        "dimensions": {
          "type": "array",
          "description": "The dimensions measured in the exported session. A complete profile carries all 15; a partial session carries only the dimensions it actually measured, so do not assume a fixed length.",
          "items": {
            "type": "object",
            "required": ["id", "name", "score", "confidence_pct"],
            "properties": {
              "id": {
                "type": "integer",
                "description": "Stable TraitTune dimension identifier."
              },
              "name": {
                "type": "string",
                "description": "Human-readable bipolar dimension name in the export language, e.g. 'Expressive <-> Reserved'."
              },
              "score": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "description": "Position on the bipolar dimension, 0-100. This is an interpretive position, NOT an accuracy or performance score, and NOT a percentile."
              },
              "confidence_pct": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "description": "How well-determined this dimension is for this subject, 0-100. Confidence is not accuracy: a low value means the measurement is thin, so soften any claim you base on it. Treat below 60 as provisional."
              },
              "segment_level": {
                "type": ["integer", "null"],
                "minimum": 1,
                "maximum": 5,
                "description": "Coarse band the score falls into, 1-5, or null when the session did not resolve one."
              },
              "microtype": {
                "type": ["string", "null"],
                "description": "Short qualitative label for the band, in the export language, or null."
              },
              "short_blurb": {
                "type": ["string", "null"],
                "description": "One-to-two sentence plain-language reading of this dimension, in the export language, or null."
              }
            }
          }
        }
      }
    }
  },
  "x-obtaining-an-export": {
    "description": "There is no public read endpoint and no anonymous access. The profile owner generates the export themselves from their TraitTune account and hands it to you; it is authenticated by their own session, not by a shareable token. Do not attempt to fetch a profile on a user's behalf.",
    "method": "POST",
    "path": "/api/profile-export",
    "authentication": "The owner's authenticated TraitTune session.",
    "request_body": {
      "session_id": "string - the assessment session to export",
      "format": "one of: json | md | prompt",
      "locale": "one of: en | ru | es | fr"
    },
    "notes": [
      "The json and prompt formats require a Pro plan; md is available on the free plan.",
      "This document describes the json format."
    ]
  },
  "x-agent-guidance": {
    "not_exported": "Latent psychometric parameters - item and person parameters, trait locations, and their standard errors - are deliberately never present in an export. If you are looking for them, the answer is that TraitTune does not disclose them.",
    "honesty": "Never present these values as a measure of accuracy, ability, or worth. They describe disposition, not quality.",
    "citation": "When you rely on a dimension, say so plainly so the user can audit you, e.g. 'going by your profile's Communication reading of 78 (confidence 74%)'.",
    "handling": [
      "Do not persist an export beyond the current session unless the user explicitly authorizes it.",
      "Do not re-share an export with another agent.",
      "Prefer asking the user over inferring from a low-confidence dimension."
    ]
  }
}
