{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://shaunmarshall.com/cv/09/cv.schema.json",
  "title": "Shaun Marshall public CV records",
  "description": "Structured public career records. Dates use ISO 8601 with an explicit precision; an end of null means ongoing. Verification values: public_artifact (a linked public artifact supports the claim) or self_reported (owner's records, no public artifact).",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "content_version",
    "updated_at",
    "canonical_url",
    "verification_vocabulary",
    "person",
    "experience",
    "projects",
    "skills",
    "education",
    "certifications",
    "clearances",
    "memberships",
    "awards",
    "community_leadership",
    "evidence",
    "metrics"
  ],
  "$defs": {
    "id": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]+$"
    },
    "datePoint": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "date",
        "precision"
      ],
      "properties": {
        "date": {
          "type": "string",
          "pattern": "^\\d{4}(-\\d{2}(-\\d{2})?)?$"
        },
        "precision": {
          "enum": [
            "year",
            "month",
            "day"
          ]
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "precision": {
                "const": "year"
              }
            }
          },
          "then": {
            "properties": {
              "date": {
                "pattern": "^\\d{4}$"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "precision": {
                "const": "month"
              }
            }
          },
          "then": {
            "properties": {
              "date": {
                "pattern": "^\\d{4}-\\d{2}$"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "precision": {
                "const": "day"
              }
            }
          },
          "then": {
            "properties": {
              "date": {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              }
            }
          }
        }
      ]
    },
    "nullableDate": {
      "oneOf": [
        {
          "$ref": "#/$defs/datePoint"
        },
        {
          "type": "null"
        }
      ]
    },
    "verification": {
      "enum": [
        "public_artifact",
        "self_reported"
      ]
    },
    "idList": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/id"
      },
      "uniqueItems": true
    },
    "url": {
      "type": "string",
      "pattern": "^(https://|mailto:)"
    }
  },
  "properties": {
    "schema_version": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    },
    "content_version": {
      "type": "string"
    },
    "updated_at": {
      "type": "string",
      "format": "date"
    },
    "canonical_url": {
      "$ref": "#/$defs/url"
    },
    "verification_vocabulary": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "person": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "display_name",
        "headline",
        "summary",
        "location",
        "contact",
        "links"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "alternate_names": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "headline": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "role_focus": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 5
        },
        "location": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "city",
            "region",
            "country"
          ],
          "properties": {
            "city": {
              "type": "string"
            },
            "region": {
              "type": "string"
            },
            "region_code": {
              "type": "string"
            },
            "country": {
              "type": "string"
            }
          }
        },
        "contact": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "email"
          ],
          "properties": {
            "email": {
              "type": "string",
              "format": "email"
            },
            "phone": {
              "type": "string"
            },
            "contact_page": {
              "$ref": "#/$defs/url"
            }
          }
        },
        "links": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "url"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "url": {
                "$ref": "#/$defs/url"
              }
            }
          }
        },
        "about": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "experience": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "employer",
          "engagement_type",
          "start",
          "end",
          "current",
          "scope",
          "contributions",
          "url"
        ],
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "title": {
            "type": "string",
            "description": "Title as held. A headline never replaces it."
          },
          "title_note": {
            "type": [
              "string",
              "null"
            ]
          },
          "employer": {
            "type": "string"
          },
          "client": {
            "type": [
              "string",
              "null"
            ]
          },
          "engagement_type": {
            "enum": [
              "independent",
              "direct_employment",
              "contract_assignment",
              "contract_staffing",
              "contract_project",
              "self_employed",
              "student_employment",
              "volunteer",
              "unspecified",
              "combined_engagement",
              "nonprofit_leadership"
            ]
          },
          "location": {
            "type": "string"
          },
          "start": {
            "$ref": "#/$defs/datePoint"
          },
          "end": {
            "$ref": "#/$defs/nullableDate"
          },
          "current": {
            "type": "boolean"
          },
          "scope": {
            "type": "string"
          },
          "contributions": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "text",
                "verification",
                "evidence_ids",
                "metric_ids"
              ],
              "properties": {
                "text": {
                  "type": "string"
                },
                "verification": {
                  "$ref": "#/$defs/verification"
                },
                "evidence_ids": {
                  "$ref": "#/$defs/idList"
                },
                "metric_ids": {
                  "$ref": "#/$defs/idList"
                },
                "year": {
                  "type": "integer"
                },
                "employment_period_id": {
                  "type": "string"
                }
              }
            }
          },
          "details": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "skill_ids": {
            "$ref": "#/$defs/idList"
          },
          "url": {
            "$ref": "#/$defs/url"
          },
          "employment_periods": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "employer",
                "engagement_type",
                "start",
                "end",
                "current"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "employer": {
                  "type": "string"
                },
                "engagement_type": {
                  "type": "string"
                },
                "start": {
                  "$ref": "#/$defs/datePoint"
                },
                "end": {
                  "$ref": "#/$defs/nullableDate"
                },
                "current": {
                  "type": "boolean"
                },
                "client": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "current": {
                  "const": true
                }
              }
            },
            "then": {
              "properties": {
                "end": {
                  "type": "null"
                }
              }
            }
          }
        ]
      }
    },
    "projects": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "relationship",
          "owner_role",
          "implementation_status",
          "problem",
          "owner_contribution",
          "exists_now",
          "results",
          "limitations",
          "evidence_ids"
        ],
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "name": {
            "type": "string"
          },
          "relationship": {
            "type": "string"
          },
          "owner_role": {
            "type": "string"
          },
          "implementation_status": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "stage",
              "label",
              "status_line"
            ],
            "properties": {
              "stage": {
                "enum": [
                  "specification",
                  "prototype",
                  "lab",
                  "library_release",
                  "pilot",
                  "production",
                  "completed_internal"
                ]
              },
              "label": {
                "type": "string"
              },
              "status_line": {
                "type": "string"
              }
            }
          },
          "problem": {
            "type": "string"
          },
          "owner_contribution": {
            "type": "string"
          },
          "exists_now": {
            "type": "string"
          },
          "results": {
            "type": "string"
          },
          "limitations": {
            "type": "string"
          },
          "terms": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "evidence_ids": {
            "$ref": "#/$defs/idList"
          },
          "metric_ids": {
            "$ref": "#/$defs/idList"
          },
          "experience_ids": {
            "$ref": "#/$defs/idList"
          },
          "url": {
            "$ref": "#/$defs/url"
          }
        }
      }
    },
    "skills": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "items"
        ],
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "name": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "term",
                "period",
                "demonstrated_in"
              ],
              "properties": {
                "id": {
                  "$ref": "#/$defs/id"
                },
                "term": {
                  "type": "string"
                },
                "period": {
                  "enum": [
                    "current",
                    "historical"
                  ]
                },
                "demonstrated_in": {
                  "$ref": "#/$defs/idList"
                }
              }
            }
          }
        }
      }
    },
    "education": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "institution",
          "program",
          "status",
          "degree_conferred"
        ],
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "institution": {
            "type": "string"
          },
          "location": {
            "type": [
              "string",
              "null"
            ]
          },
          "program": {
            "type": "string"
          },
          "start": {
            "$ref": "#/$defs/nullableDate"
          },
          "end": {
            "$ref": "#/$defs/nullableDate"
          },
          "status": {
            "type": "string"
          },
          "degree_conferred": {
            "type": "boolean"
          },
          "courses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "certifications": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "issuer",
          "status"
        ],
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "name": {
            "type": "string"
          },
          "issuer": {
            "type": "string"
          },
          "earned": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "expires": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "status": {
            "enum": [
              "Held",
              "Expired",
              "Previously held"
            ]
          },
          "status_note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "clearances": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "status"
        ],
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "const": "Previously held"
          }
        }
      }
    },
    "memberships": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "awards": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "issuer",
          "year"
        ],
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "name": {
            "type": "string"
          },
          "issuer": {
            "type": "string"
          },
          "year": {
            "type": "integer"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "community_leadership": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "role",
          "organization",
          "current",
          "points"
        ],
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "role": {
            "type": "string"
          },
          "organization": {
            "type": "string"
          },
          "organization_note": {
            "type": [
              "string",
              "null"
            ]
          },
          "start": {
            "$ref": "#/$defs/nullableDate"
          },
          "end": {
            "$ref": "#/$defs/nullableDate"
          },
          "current": {
            "type": "boolean"
          },
          "points": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "evidence_ids": {
            "$ref": "#/$defs/idList"
          },
          "skill_ids": {
            "$ref": "#/$defs/idList"
          }
        }
      }
    },
    "evidence": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "url",
          "source_type",
          "supports",
          "checked",
          "verification_status"
        ],
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "$ref": "#/$defs/url"
          },
          "source_type": {
            "type": "string"
          },
          "supports": {
            "type": "string"
          },
          "checked": {
            "type": "string",
            "format": "date"
          },
          "verification_status": {
            "const": "public_artifact"
          }
        }
      }
    },
    "metrics": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "value",
          "unit",
          "scope",
          "period",
          "approximate",
          "method",
          "verification"
        ],
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "value": {
            "type": [
              "number",
              "null"
            ]
          },
          "unit": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "period": {
            "type": "string"
          },
          "approximate": {
            "type": "boolean"
          },
          "method": {
            "type": "string"
          },
          "verification": {
            "$ref": "#/$defs/verification"
          }
        }
      }
    }
  }
}
