{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://personspec.org/schema/v0.1/personspec.json",
  "title": "PersonSpec",
  "description": "An open standard for machine-readable personal-brand definitions. Defines a person's identity, why, pillars, voice, vocabulary, structure, and guardrails — and their alignment to one or more parent BrandSpecs.",
  "type": "object",
  "required": ["person", "version"],
  "properties": {

    "$schema": {
      "type": "string",
      "format": "uri",
      "description": "URI of the PersonSpec schema used to validate this document."
    },

    "version": {
      "type": "string",
      "description": "PersonSpec schema version this document conforms to.",
      "examples": ["0.1.0"]
    },

    "_export": {
      "type": "object",
      "description": "Export metadata generated by the tool that produced this file.",
      "properties": {
        "personName":         { "type": "string", "description": "Name of the person at time of export." },
        "personSpecVersion":  { "type": "string", "description": "PersonSpec version used at export time." },
        "exportedAt":         { "type": "string", "format": "date-time", "description": "ISO 8601 timestamp of export." }
      }
    },

    "person": {
      "type": "object",
      "description": "The root person definition object.",
      "required": ["identity"],
      "properties": {

        "identity": {
          "type": "object",
          "description": "Who the person is and which organisations they represent.",
          "required": ["name"],
          "properties": {
            "name":     { "type": "string", "description": "The person's full name." },
            "role":     { "type": "string", "description": "Primary professional role or title." },
            "headline": { "type": "string", "description": "Short professional headline (≤140 chars)." },
            "pronouns": { "type": "string", "description": "Pronouns the person uses." },
            "links": {
              "type": "object",
              "description": "Public profile links.",
              "properties": {
                "website":  { "type": "string", "format": "uri" },
                "linkedin": { "type": "string", "format": "uri" },
                "email":    { "type": "string", "format": "email" }
              }
            },
            "parents": {
              "type": "array",
              "description": "References to parent BrandSpecs the person represents. PersonSpec is relational — the alignment object on each parent describes the relationship.",
              "items": {
                "type": "object",
                "required": ["brandspec"],
                "properties": {
                  "brandspec": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL of the parent BrandSpec JSON document."
                  },
                  "role": {
                    "type": "string",
                    "description": "The person's role within this parent organisation."
                  },
                  "scope": {
                    "type": "string",
                    "enum": ["primary", "secondary", "advisory", "historical"],
                    "description": "The relative weight of this parent relationship in the person's public communication."
                  },
                  "alignment": {
                    "type": "object",
                    "description": "How the person's voice and pillars relate to this parent brand.",
                    "properties": {
                      "voiceDelta": {
                        "type": "string",
                        "description": "How the person's voice differs from the parent brand voice (e.g. 'warmer, more first-person')."
                      },
                      "topicScope": {
                        "type": "string",
                        "description": "Which topics the person addresses on behalf of this parent ('all', 'leadership only', 'product only', etc)."
                      },
                      "tensions": {
                        "type": "array",
                        "items": { "type": "string" },
                        "description": "Acknowledged points of healthy tension between personal and parent positions."
                      }
                    }
                  }
                }
              }
            }
          }
        },

        "why": {
          "type": "object",
          "description": "The discovery layer — the person's purpose, archetype, inner-development profile, and synthesised Why statement.",
          "properties": {
            "work": {
              "type": "object",
              "description": "What the person actually does.",
              "properties": {
                "satisfaction":    { "type": "string", "description": "What aspect of the work brings them most satisfaction." },
                "problemsSolved":  { "type": "string", "description": "The kind of problems they're uniquely placed to tackle." }
              }
            },
            "people": {
              "type": "object",
              "description": "Who they help and why.",
              "properties": {
                "howIHelp":    { "type": "string", "description": "Concrete ways their work lands for another human." },
                "whyIWork":    { "type": "string", "description": "What keeps them showing up beneath the salary." }
              }
            },
            "impact": {
              "type": "object",
              "description": "The change they want their career to leave.",
              "properties": {
                "striving":    { "type": "string", "description": "The change they want their career — not a single project — to leave." },
                "betterWorld": { "type": "string", "description": "How they make the world better, even a small corner of it." }
              }
            },
            "widerWorld": {
              "type": "object",
              "description": "Honest assessment of impact on nature and community.",
              "properties": {
                "nature":    { "type": "string", "description": "How their work impacts nature, direct or indirect." },
                "community": { "type": "string", "description": "Impact on immediate community, industry, or wider public." }
              }
            },
            "archetype": {
              "type": "string",
              "enum": [
                "innocent", "sage", "explorer", "outlaw", "magician",
                "hero", "lover", "jester", "everyman", "caregiver",
                "ruler", "creator"
              ],
              "description": "The brand archetype anchoring the voice's emotional register. Based on the twelve-archetype model (Jung-derived, Mark & Pearson)."
            },
            "innerDevelopment": {
              "type": "object",
              "description": "Self-assessment scores against the Inner Development Goals framework. Each dimension is rated 1–5.",
              "properties": {
                "being":         { "type": "integer", "minimum": 1, "maximum": 5, "description": "Relationship to self — inner compass, integrity, self-awareness, presence, openness." },
                "thinking":      { "type": "integer", "minimum": 1, "maximum": 5, "description": "Cognitive skills — critical thinking, complexity awareness, long-term visioning, sense-making." },
                "relating":      { "type": "integer", "minimum": 1, "maximum": 5, "description": "Caring for others — appreciation, connectedness, humility, empathy, compassion." },
                "collaborating": { "type": "integer", "minimum": 1, "maximum": 5, "description": "Social skills — communication, co-creation, trust, inclusive mindset, mobilisation." },
                "acting":        { "type": "integer", "minimum": 1, "maximum": 5, "description": "Driving change — courage, creativity, optimism, perseverance." }
              }
            },
            "statement": {
              "type": "string",
              "description": "The synthesised Why statement — a single sentence capturing the person's purpose."
            }
          }
        },

        "pillars": {
          "type": "array",
          "description": "Content pillars the person speaks to. Each is mapped to a parent-brand pillar where applicable, with notes on the relationship.",
          "items": {
            "type": "object",
            "required": ["name"],
            "properties": {
              "name":         { "type": "string", "description": "Short pillar name." },
              "description":  { "type": "string", "description": "What this pillar covers." },
              "parentPillar": { "type": ["string", "null"], "description": "Slug or name of the corresponding parent-brand pillar. Null for personal-only pillars with no parent equivalent." },
              "relationship": {
                "type": "string",
                "enum": ["reinforces", "extends", "tension", "personal-only"],
                "description": "How the personal pillar relates to its parent. 'reinforces' aligns directly; 'extends' takes the parent further; 'tension' is a known healthy disagreement; 'personal-only' has no parent equivalent."
              }
            }
          }
        },

        "voice": {
          "type": "object",
          "description": "How the person sounds.",
          "properties": {
            "tone": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Tone descriptors (e.g. 'curious', 'warm', 'direct', 'dry')."
            },
            "sentenceStyle": {
              "type": "string",
              "enum": ["short", "long", "mixed"],
              "description": "Default sentence-length character."
            },
            "formality": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5,
              "description": "1 = very casual, 5 = very formal."
            },
            "humour": {
              "type": "string",
              "enum": ["none", "dry", "self-deprecating", "playful", "sharp", "warm"],
              "description": "Humour register."
            },
            "perspective": {
              "type": "string",
              "enum": ["first-person", "second-person", "third-person", "we"],
              "description": "Default narrative perspective."
            }
          }
        },

        "vocabulary": {
          "type": "object",
          "description": "Lexical preferences and constraints.",
          "properties": {
            "signaturePhrases": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Phrases the person uses consistently."
            },
            "avoid": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Words and phrases the person never uses."
            },
            "industryLanguage": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Domain-specific terms the audience expects to see."
            }
          }
        },

        "structure": {
          "type": "object",
          "description": "Structural defaults for new content.",
          "properties": {
            "hookStyle": {
              "type": "string",
              "enum": ["story", "stat", "question", "statement", "contrarian"],
              "description": "Default opening pattern."
            },
            "defaultLength": {
              "type": "string",
              "enum": ["very-short", "short", "medium", "long"],
              "description": "Default content length."
            },
            "signoffStyle": {
              "type": "string",
              "enum": ["none", "tagline", "question", "cta", "signature"],
              "description": "Default closing convention."
            }
          }
        },

        "guardrails": {
          "type": "object",
          "description": "Topics, positions, and confidentiality boundaries that constrain output.",
          "properties": {
            "topicsAvoid": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Topics to steer clear of entirely."
            },
            "positionsTaken": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Stances the person has publicly committed to — used to keep future output consistent."
            },
            "confidentiality": {
              "type": "string",
              "description": "Company or client boundaries that must not be crossed."
            }
          }
        },

        "metadata": {
          "type": "object",
          "description": "Administrative fields used for versioning, auditing, and tool compatibility.",
          "properties": {
            "name":        { "type": "string", "description": "Person name as recorded in the spec." },
            "version":     { "type": "string", "description": "Document version string (semantic versioning recommended).", "examples": ["1.0.0"] },
            "lastUpdated": { "type": "string", "format": "date-time", "description": "ISO 8601 timestamp of the last update." },
            "tags": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Free-form tags for tool integrations."
            },
            "provenance": {
              "type": "object",
              "description": "How the document was produced and on what basis. Required for any document not authored directly by the subject. See personspec.org/privacy for guidance.",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": ["self-reported", "inferred", "observed", "hybrid"],
                  "description": "How the document came to exist. 'self-reported' = subject authored it. 'inferred' = derived from other data such as public writing samples. 'observed' = produced from observable behaviour. 'hybrid' = a mix, document the dominant source."
                },
                "consent": {
                  "type": "string",
                  "enum": ["subject", "guardian", "public-figure-doctrine", "none-claimed"],
                  "description": "Who consented to the document's creation. 'subject' = the person themselves. 'guardian' = an authorised representative under jurisdiction-specific rules (parental consent for minors, lasting power of attorney, executors of estates). 'public-figure-doctrine' = produced from material the subject made manifestly public. 'none-claimed' = no claim of consent (a transparent admission, not an authorisation)."
                },
                "confidence": {
                  "type": "string",
                  "enum": ["high", "medium", "low"],
                  "description": "Producer's honest assessment of how reliably the document represents the subject. Self-reported documents are typically high; sparsely-inferred documents typically low."
                },
                "inferredFrom": {
                  "type": "array",
                  "items": { "type": "string", "format": "uri" },
                  "description": "URLs of source material used when type is 'inferred' or 'observed'. Recommended for inferred documents; required for transparent-by-design tools."
                }
              }
            }
          }
        }

      }
    }
  }
}
