{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tyrvar.com/schemas/well-known-trust-profile-0.1.json",
  "title": "Well-known trust profile, proposal 0.1",
  "description": "Public subset of trust profile export 1.3, served at /.well-known/trust-profile.json. A vendor statement, not an attestation. Proposal, not a standard.",
  "type": "object",
  "required": ["trust_profile_version", "generated_at", "vendor", "answers"],
  "properties": {
    "trust_profile_version": {
      "description": "Version of this convention, MAJOR.MINOR.",
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]+$"
    },
    "generated_at": {
      "description": "When the file was produced (UTC).",
      "type": "string",
      "format": "date-time"
    },
    "vendor": {
      "type": "object",
      "required": ["name"],
      "properties": {
        "name": { "type": "string" },
        "url": { "type": "string", "format": "uri" }
      }
    },
    "answers": {
      "description": "Only answers the vendor chose to share with anyone. Sorted by key_code.",
      "type": "array",
      "items": { "$ref": "#/$defs/PublicAnswer" }
    }
  },
  "$defs": {
    "PublicAnswer": {
      "type": "object",
      "required": ["key_code", "question", "text", "assurance", "last_reviewed_at"],
      "properties": {
        "key_code": {
          "description": "Canonical key code (export 1.3 canonical_key.key_code).",
          "type": "string"
        },
        "question": {
          "description": "Canonical question (export 1.3 canonical_key.question).",
          "type": "string"
        },
        "text": {
          "description": "The vendor's answer text (export 1.3 text).",
          "type": "string"
        },
        "assurance": {
          "description": "Where the claim comes from (export 1.3 assurance). A label of source, not a check by any third party.",
          "enum": [
            "inherited_platform",
            "inherited_confirmed",
            "evidenced",
            "asserted",
            "unreviewed"
          ]
        },
        "last_reviewed_at": {
          "description": "When a person last reviewed the answer (export 1.3 last_reviewed_at). Null when never reviewed.",
          "anyOf": [
            { "type": "string", "format": "date-time" },
            { "type": "null" }
          ]
        },
        "evidence": {
          "description": "Titles of supporting documents. No files, links or ids.",
          "type": "array",
          "items": {
            "type": "object",
            "required": ["title"],
            "properties": {
              "title": { "type": "string" }
            }
          },
          "default": []
        }
      }
    }
  }
}
