{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://nstarkman.space/schema/item.schema.json",
  "title": "CV / site item",
  "description": "One item in the database. Every item is its own file, named data/<date.start>-<id>.json — the start date first so the directory lists chronologically, then the id, which is the identity everything else points at. A year-only date gives 2019-<id>.json; a dated one gives 2026-10-<id>.json. Two additions never conflict, and the filename cannot disagree with the record: npm run test:schema rejects it. Rendered into the website, the profile README, and the CV PDFs.",
  "type": "object",
  "unevaluatedProperties": false,
  "required": [
    "id",
    "type",
    "date",
    "title"
  ],
  "properties": {
    "$schema": {
      "type": "string"
    },
    "id": {
      "description": "Globally unique slug, and the second half of the filename (<date.start>-<id>.json). Never change it once merged — refs, cross-links and the published /records/<id>.json URL all point at it.",
      "type": "string",
      "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
      "minLength": 2,
      "maxLength": 80
    },
    "type": {
      "description": "Drives which extra fields apply and which CV section the item lands in.",
      "enum": [
        "publication",
        "software",
        "education",
        "position",
        "fellowship",
        "award",
        "grant",
        "presentation",
        "mentoring",
        "teaching",
        "service",
        "media",
        "outreach",
        "highlight"
      ]
    },
    "cvs": {
      "description": "Which CV presets include this item, by the names in config/presets.json. Omit or leave empty for none — the complete CV takes everything regardless. This replaced the `% SKIP: (*)` markers the LaTeX CV used.",
      "type": "array",
      "items": {
        "enum": [
          "np",
          "2page",
          "1page"
        ]
      },
      "uniqueItems": true
    },
    "featured": {
      "description": "Surface on the website landing page rather than only the full listing.",
      "type": "boolean",
      "default": false
    },
    "date": {
      "$ref": "#/$defs/dateRange",
      "description": "`start` also prefixes the filename, so correcting it renames the file."
    },
    "title": {
      "description": "The name of the thing this records: a job title for a plain job; otherwise the program, fellowship, grant, award, course, committee, package or event. A publication's title is the paper's. My part in it goes in `role`, not here.",
      "type": "string",
      "minLength": 2
    },
    "shortTitle": {
      "description": "The title cut down for a card: shorter than `title`, about two lines on a card at most, in title case. A card set to its `short` title shows this, falling back to `title`.",
      "type": "string",
      "minLength": 2
    },
    "nickTitle": {
      "description": "The item's name in a few words, as it is called in a sentence, e.g. \"Stream Members Only\". A card set to its `nick` title shows this, and so does the text-sized inline-card a /research/ introduction draws for `[](item:<id>)`. Falls back to `shortTitle`, then `title`.",
      "type": "string",
      "minLength": 2,
      "maxLength": 32
    },
    "summary": {
      "description": "The one line. Always rendered, including in the two-page CV.",
      "type": "string"
    },
    "details": {
      "description": "Elaboration, as a string or one string per line. Rendered by the website and the long CVs; the short presets drop it. May carry [text](url) and [text](item:some-id) links.",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1
        }
      ]
    },
    "detailsComplete": {
      "description": "Elaboration only the complete CV shows \u2014 the tier below `details`. `summary` always renders; `details` renders on the website and the long CVs and is dropped by the short presets; this renders in the complete CV alone. For the fact that is true and on the record but does not belong on a CV you hand someone, such as a GPA. Same string-or-lines shape as `details`, and appended after it.",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1
        }
      ]
    },
    "links": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/link"
      },
      "uniqueItems": true
    },
    "refs": {
      "description": "Other items this one points at, by bare id (was \\hyperref). A media entry cites the paper it covered.",
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
      },
      "uniqueItems": true
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
      },
      "uniqueItems": true
    },
    "internal": {
      "description": "Maintainer note. Never rendered anywhere. (Not BibTeX `note` — that is derived from `status`.)",
      "type": "string"
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "type": {
            "const": "publication"
          }
        },
        "required": [
          "type"
        ]
      },
      "then": {
        "required": [
          "authors",
          "status",
          "entryType",
          "refereed"
        ],
        "properties": {
          "authors": {
            "$ref": "#/$defs/authors",
            "description": "The FULL author list, in order. Renderers truncate per preset — never pre-truncate here, or the BibTeX is wrong."
          },
          "editors": {
            "$ref": "#/$defs/authors"
          },
          "funding": {
            "description": "What funded the paper, as its acknowledgements say: one entry per award, funder first. A paper's site lists it under Funding. `recipients` are the award's holders among the authors (its PI, or the fellow), by family name: not who was paid from it; none when no author holds it. `grant` is my own record of the award, where I hold it.",
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "funder"
              ],
              "properties": {
                "funder": {
                  "description": "Who gave it, by its own name: National Science Foundation, VILLUM FONDEN.",
                  "type": "string",
                  "minLength": 1
                },
                "award": {
                  "description": "The award or program: CAREER award, Graduate Research Fellowship.",
                  "type": "string",
                  "minLength": 1
                },
                "number": {
                  "description": "The award's number as the funder writes it: AST-2337864.",
                  "type": "string",
                  "minLength": 1
                },
                "recipients": {
                  "type": "array",
                  "minItems": 1,
                  "uniqueItems": true,
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "grant": {
                  "description": "The id of my grant or fellowship record for this award.",
                  "type": "string",
                  "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
                }
              }
            }
          },
          "collaboration": {
            "description": "Leading collaboration byline, e.g. \"Euclid Collaboration\", when the full list runs to hundreds.",
            "type": "string"
          },
          "authorPosition": {
            "description": "Credit position, when it differs from where the owner sits in `authors`. Normally omitted — the position is derived from the index of the author marked `me`, which is correct for every record so far, Euclid included: `collaboration` is a separate field and so takes no author slot. Set this where the byline understates the credit, or to have a position past third stated exactly rather than as \"nth\" on /research/'s cards — Astropy v5.0, where fourth is the first author after the leads. Named for the first four; a plain number beyond.",
            "oneOf": [
              { "enum": ["first", "second", "third", "fourth"] },
              { "type": "integer", "minimum": 5 }
            ]
          },
          "status": {
            "enum": [
              "in-prep",
              "submitted",
              "accepted",
              "published"
            ]
          },
          "refereed": {
            "description": "How the work is refereed: `journal` — published, accepted, submitted or written for a refereed journal (JOSS included); `proceedings` — a peer-reviewed conference or workshop paper; `false` — not refereed (a meeting report, a white paper). Never emitted to BibTeX. A CV may split its publications by it.",
            "enum": ["journal", "proceedings", false]
          },
          "entryType": {
            "description": "BibTeX entry type. Not derivable from `status` alone — a published conference paper is @inproceedings, a preprint is @misc.",
            "enum": [
              "article",
              "inproceedings",
              "incollection",
              "book",
              "phdthesis",
              "techreport",
              "misc",
              "unpublished"
            ]
          },
          "citeslug": {
            "description": "The citekey's last part, where it is not the id. The key itself is derived — see citekey() in src/lib/bibtex.js and constitution Article VI.",
            "type": "string",
            "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
          },
          "preliminaryOf": {
            "description": "Id of the full paper this one is an earlier, shorter version of — a workshop or conference proceeding. /publications/ lists it under that paper instead of as an entry of its own; the BibTeX file keeps both. Set it on the proceeding, not on the paper.",
            "type": "string",
            "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
          },
          "venue": {
            "$ref": "#/$defs/venue"
          },
          "abstract": {
            "description": "The paper abstract, verbatim. Shown on the website and emitted into BibTeX; never in the CV.",
            "type": "string"
          },
          "arxiv": {
            "type": "string",
            "pattern": "^\\d{4}\\.\\d{4,5}(v\\d+)?$"
          },
          "primaryClass": {
            "description": "arXiv primary category, e.g. astro-ph.GA. Emitted as BibTeX primaryClass alongside eprint.",
            "type": "string",
            "pattern": "^[a-z-]+(\\.[A-Za-z-]+)?$"
          },
          "bibcode": {
            "$ref": "#/$defs/bibcode"
          },
          "doi": {
            "$ref": "#/$defs/doi"
          },
          "citations": {
            "type": "integer",
            "minimum": 0
          },
          "highlight": {
            "$ref": "#/$defs/highlight",
            "description": "This paper's card in Research Highlights on /research/. Links out through the paper's own links."
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "type": {
            "const": "software"
          }
        },
        "required": [
          "type"
        ]
      },
      "then": {
        "required": [
          "tier",
          "group"
        ],
        "properties": {
          "group": {
            "description": "Which area of the software listing it sits in. The areas, their order and their one-line introductions are SOFTWARE_GROUPS in src/lib/data.js; `tier` then sets its card's size within the area.",
            "enum": [
              "astropy",
              "foundations",
              "dynamics",
              "dark-matter",
              "numerics",
              "utilities"
            ]
          },
          "tier": {
            "description": "Prominence on the website's software listing. From most to least prominent: `flagship`, `major`, `minor`, `utility`. Exactly one item should be `flagship`. `utility` is the small-card tier below the rest \u2014 things worth having but not research software. Keeping this in data is what removed an `id === \"astropy\"` special case from the page.",
            "enum": [
              "flagship",
              "major",
              "minor",
              "utility"
            ]
          },
          "repo": {
            "type": "string",
            "pattern": "^[\\w.-]+/[\\w.-]+$",
            "description": "owner/name on GitHub. Drives the star count."
          },
          "authors": {
            "$ref": "#/$defs/authors"
          },
          "version": {
            "type": "string"
          },
          "order": {
            "type": "integer",
            "description": "Position within the `major` tier. Lower first; items without it count as 0 and keep their newest-first order, so a positive value sends one to the end."
          },
          "highlight": {
            "$ref": "#/$defs/highlight",
            "description": "The package's figure, for its card where a card shows one — its logo, say. The topic is `software`, which /research/ does not list."
          },
          "role": {
            "$ref": "#/$defs/role"
          },
          "doi": {
            "$ref": "#/$defs/doi"
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "type": {
            "const": "education"
          }
        },
        "required": [
          "type"
        ]
      },
      "then": {
        "required": [
          "institution"
        ],
        "properties": {
          "institution": {
            "type": "string"
          },
          "institutionNames": {
            "type": "array",
            "items": { "type": "string", "minLength": 1 },
            "minItems": 1
          },
          "degree": {
            "type": "string"
          },
          "thesis": {
            "type": "string"
          },
          "supervisors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "location": {
            "type": "string"
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "type": {
            "const": "position"
          }
        },
        "required": [
          "type"
        ]
      },
      "then": {
        "required": [
          "institution"
        ],
        "properties": {
          "institution": {
            "type": "string"
          },
          "institutionNames": {
            "type": "array",
            "items": { "type": "string", "minLength": 1 },
            "minItems": 1
          },
          "role": {
            "$ref": "#/$defs/role"
          },
          "location": {
            "type": "string"
          },
          "groupRoles": {
            "type": "boolean",
            "description": "Print this role together with the others at the same institution that set this too, as one row — \"Coordinator & Core Developer, Astropy\". Only roles that opt in are grouped."
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "type": {
            "const": "fellowship"
          }
        },
        "required": [
          "type"
        ]
      },
      "then": {
        "required": [
          "tier"
        ],
        "properties": {
          "tier": {
            "description": "Named, awarded support held by me sits with Grants & Fellowships (major) or Small Grants (minor), as a grant does.",
            "enum": [
              "major",
              "minor"
            ]
          },
          "institution": {
            "description": "The host where it was held — MIT Kavli for the Brinson. Printed only when the fellowship has no funder; a funder switched off prints nothing in its place.",
            "type": "string"
          },
          "institutionNames": {
            "type": "array",
            "items": { "type": "string", "minLength": 1 },
            "minItems": 1
          },
          "funder": {
            "description": "Who awards it — the Brinson Foundation. Printed after the role.",
            "type": "string"
          },
          "role": {
            "$ref": "#/$defs/role"
          },
          "amount": {
            "$ref": "#/$defs/amount"
          },
          "declined": {
            "type": "boolean",
            "default": false
          },
          "location": {
            "type": "string"
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "type": {
            "enum": [
              "award",
              "grant"
            ]
          }
        },
        "required": [
          "type"
        ]
      },
      "then": {
        "required": [
          "tier"
        ],
        "properties": {
          "tier": {
            "description": "Your CV separates Grants & Fellowships (type grant) and Awards (type award) from Small Grants and Travel Awards. type x tier gives those four buckets; presets.json maps each to a heading.",
            "enum": [
              "major",
              "minor"
            ]
          },
          "amount": {
            "$ref": "#/$defs/amount"
          },
          "declined": {
            "type": "boolean",
            "default": false
          },
          "funder": {
            "type": "string"
          },
          "role": {
            "$ref": "#/$defs/role"
          },
          "recipient": {
            "description": "Who received it, when that is not the CV's owner — a team award belongs on the CV but must not read as a personal one.",
            "type": "string"
          },
          "recipientInline": {
            "description": "Print the recipient on the title line, after the links, instead of on a line of its own (PDF CV).",
            "type": "boolean",
            "default": false
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "type": {
            "const": "presentation"
          }
        },
        "required": [
          "type"
        ]
      },
      "then": {
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "description": "Separates invited talks from contributed ones, posters, organising, and plain attendance — the distinction the CV's separate sections used to carry. `accepted` is a talk accepted but never given, because I could not attend.",
            "enum": [
              "invited",
              "contributed",
              "poster",
              "seminar",
              "organizer",
              "attended",
              "accepted"
            ]
          },
          "event": {
            "type": "string",
            "description": "The meeting, workshop or seminar series."
          },
          "location": {
            "type": "string"
          },
          "talk": {
            "type": "string",
            "minLength": 1,
            "description": "The title of the talk or poster, without quotation marks: renderers add them. Notes that are not the title (a role, a lecturer's post) stay in `details`."
          },
          "role": {
            "$ref": "#/$defs/role"
          },
          "professional": {
            "type": "boolean",
            "description": "True when the talk is about software or the community, not science: it then lists under Professional & Software Talks rather than with the science talks."
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "type": {
            "const": "mentoring"
          }
        },
        "required": [
          "type"
        ]
      },
      "then": {
        "required": [
          "student"
        ],
        "properties": {
          "student": {
            "type": "string"
          },
          "institution": {
            "type": "string"
          },
          "coSupervisors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "outputs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What the student produced — talks, posters, papers."
          },
          "person": {
            "description": "The mentee as a person, which makes this record a profile at /people/<slug>/. Needs `slug`.",
            "type": "object",
            "additionalProperties": false,
            "required": [
              "family",
              "given",
              "level"
            ],
            "properties": {
              "family": {
                "type": "string",
                "minLength": 1
              },
              "given": {
                "type": "string",
                "minLength": 1
              },
              "orcid": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{4}-\\d{4}-\\d{3}[\\dX]$"
              },
              "level": {
                "enum": [
                  "undergraduate",
                  "graduate",
                  "postbac",
                  "postdoc",
                  "summer-associate"
                ]
              }
            }
          },
          "slug": {
            "description": "The profile's URL segment, /people/<slug>/.",
            "type": "string",
            "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
          },
          "photo": {
            "description": "Path under public/.",
            "type": "string",
            "pattern": "^people/[a-z0-9-]+\\.(webp|jpg|png)$"
          },
          "badge": {
            "type": "string",
            "minLength": 1
          },
          "research": {
            "type": "string",
            "minLength": 1
          },
          "journey": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "organization",
                "country",
                "start"
              ],
              "properties": {
                "organization": {
                  "type": "string",
                  "minLength": 1
                },
                "city": {
                  "type": "string",
                  "minLength": 1
                },
                "region": {
                  "type": "string",
                  "minLength": 1
                },
                "country": {
                  "type": "string",
                  "minLength": 1
                },
                "start": {
                  "$ref": "#/$defs/partialDate"
                },
                "end": {
                  "$ref": "#/$defs/partialDate"
                },
                "role": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "achievements": {
            "description": "What the mentee did, kept in their own record and never as the owner's items.",
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "kind",
                "date",
                "title"
              ],
              "properties": {
                "kind": {
                  "enum": [
                    "award",
                    "talk",
                    "poster",
                    "press",
                    "program"
                  ]
                },
                "date": {
                  "$ref": "#/$defs/partialDate"
                },
                "title": {
                  "type": "string",
                  "minLength": 1
                },
                "event": {
                  "type": "string",
                  "minLength": 1
                },
                "location": {
                  "type": "string",
                  "minLength": 1
                },
                "outlet": {
                  "type": "string",
                  "minLength": 1
                },
                "url": {
                  "type": "string",
                  "pattern": "^https?://\\S+$"
                },
                "cvs": {
                  "description": "Which CV presets include this item, by the names in config/presets.json. Omit or leave empty for none — the complete CV takes everything regardless. This replaced the `% SKIP: (*)` markers the LaTeX CV used.",
                  "type": "array",
                  "items": {
                    "enum": [
                      "np",
                      "2page",
                      "1page"
                    ]
                  },
                  "uniqueItems": true
                }
              }
            }
          }
        },
        "dependentRequired": {
          "slug": [
            "person"
          ],
          "photo": [
            "person"
          ],
          "badge": [
            "person"
          ],
          "research": [
            "person"
          ],
          "journey": [
            "person"
          ],
          "achievements": [
            "person"
          ],
          "person": [
            "slug"
          ]
        }
      }
    },
    {
      "if": {
        "properties": {
          "type": {
            "const": "teaching"
          }
        },
        "required": [
          "type"
        ]
      },
      "then": {
        "properties": {
          "institution": {
            "type": "string"
          },
          "course": {
            "type": "string"
          },
          "role": {
            "$ref": "#/$defs/role"
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "type": {
            "enum": [
              "service",
              "outreach"
            ]
          }
        },
        "required": [
          "type"
        ]
      },
      "then": {
        "properties": {
          "organization": {
            "type": "string"
          },
          "role": {
            "$ref": "#/$defs/role"
          },
          "location": {
            "type": "string",
            "description": "A place in the form `City, ST, Country`, `City, Country` or `Online`, as for a presentation."
          },
          "kind": {
            "description": "How the engagement came about, e.g. a talk I was invited to give.",
            "enum": [
              "invited",
              "contributed"
            ]
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "type": {
            "const": "media"
          }
        },
        "required": [
          "type"
        ]
      },
      "then": {
        "required": [
          "outlet"
        ],
        "properties": {
          "outlet": {
            "type": "string"
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "type": {
            "const": "highlight"
          }
        },
        "required": [
          "type"
        ]
      },
      "then": {
        "description": "A research highlight that draws several papers together. Each paper keeps its own `highlight`; this one names them in `refs`, and its card links to theirs.",
        "required": [
          "highlight",
          "refs"
        ],
        "properties": {
          "highlight": {
            "$ref": "#/$defs/highlight"
          }
        }
      }
    }
  ],
  "$defs": {
    "role": {
      "description": "My part in the thing the title names — Postdoctoral Fellow, Co-I, TA, Volunteer, lead developer. Leave it out when the title already is my part; it never repeats the title.",
      "type": "string",
      "minLength": 1
    },
    "highlight": {
      "description": "A card in Research Highlights: a picture, a title and a few sentences.",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "topic",
        "image",
        "alt",
        "description"
      ],
      "properties": {
        "topic": {
          "description": "Which group of Research Highlights the card sits under on /research/. The labels and their order live in src/pages/research.astro. `software` is not in that list, so a card under it is kept in the data but not shown.",
          "enum": [
            "extragalactic",
            "galactic",
            "cmb",
            "dm-direct-detection",
            "software"
          ]
        },
        "image": {
          "description": "Path under public/, served from the site root: highlights/<id>.png puts the file at public/highlights/<id>.png.",
          "type": "string",
          "pattern": "^highlights/[\\w.-]+\\.(png|jpe?g|webp|gif|svg)$"
        },
        "source": {
          "description": "Where `image` comes from, when it is mirrored from a package's own repository: `path` on `repo`'s default branch. scripts/sync-software-figures.mjs re-makes `image` whenever that file changes, and a workflow, run every six months or by hand, opens a pull request with the result. Omit it for an image made here; the script then leaves the image alone.",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "repo",
            "path",
            "sha"
          ],
          "properties": {
            "repo": {
              "description": "owner/name on GitHub.",
              "type": "string",
              "pattern": "^[\\w.-]+/[\\w.-]+$"
            },
            "path": {
              "description": "The file in that repository, PNG or SVG. `image`'s extension picks what is made: a .webp at quality 85 (an SVG drawn 512 px wide), or for an SVG source, an .svg copied as is.",
              "type": "string",
              "pattern": "\\.(png|svg)$"
            },
            "sha": {
              "description": "Git blob SHA of the file last mirrored. Written by the script, never by hand.",
              "type": "string",
              "pattern": "^[0-9a-f]{40}$"
            }
          }
        },
        "alt": {
          "description": "What the picture shows, for anyone who cannot see it.",
          "type": "string",
          "minLength": 2
        },
        "description": {
          "description": "A few plain sentences on what was found and why it matters. May carry [text](url) links.",
          "type": "string",
          "minLength": 2
        }
      }
    },
    "partialDate": {
      "description": "YYYY, YYYY-MM or YYYY-MM-DD. Use the coarsest form you actually know.",
      "type": "string",
      "pattern": "^\\d{4}(-\\d{2}(-\\d{2})?)?$"
    },
    "dateRange": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "start"
      ],
      "properties": {
        "start": {
          "$ref": "#/$defs/partialDate"
        },
        "end": {
          "oneOf": [
            {
              "$ref": "#/$defs/partialDate"
            },
            {
              "type": "null"
            }
          ]
        },
        "present": {
          "type": "boolean",
          "default": false,
          "description": "Renders as \"2024 –\". Cannot be combined with `end`."
        }
      },
      "not": {
        "required": [
          "end",
          "present"
        ]
      }
    },
    "link": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "rel",
        "url"
      ],
      "properties": {
        "rel": {
          "description": "Closed vocabulary. Drives the README icon trail, the website buttons, and the CV glyphs from one definition — do not invent new values without adding them here.",
          "enum": [
            "paper",
            "preprint",
            "doi",
            "repo",
            "syw",
            "code",
            "docs",
            "data",
            "slides",
            "event",
            "homepage"
          ]
        },
        "url": {
          "type": "string",
          "pattern": "^https?://\\S+$"
        },
        "label": {
          "type": "string",
          "description": "Overrides the default text."
        }
      }
    },
    "author": {
      "description": "A person as `family` + `given`, so BibTeX gets \"Family, Given\" and the site gets \"G. Family\" from one entry. Use `literal` only for a non-person byline such as a collaboration, where BibTeX needs the braces preserved.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "family": {
          "type": "string",
          "minLength": 1
        },
        "given": {
          "type": "string",
          "minLength": 1
        },
        "literal": {
          "type": "string",
          "minLength": 1
        },
        "suffix": {
          "type": "string",
          "description": "Jr., III — kept out of `family` so sorting stays right."
        },
        "me": {
          "type": "boolean",
          "default": false,
          "description": "Bolds the name. Set on exactly one author."
        },
        "student": {
          "enum": ["undergraduate", "graduate"],
          "description": "A student I supervised or helped advise on this paper, and at what level. Colours the name and marks it † (undergraduate) or ‡ (graduate). A fact about the paper, so set it per paper."
        },
        "orcid": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{4}-\\d{4}-\\d{3}[\\dX]$"
        },
        "mentee": {
          "description": "The id of this author's mentoring record, where they are someone I mentored with a profile.",
          "type": "string",
          "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
        },
        "affiliation": {
          "type": "string",
          "minLength": 1,
          "description": "The affiliation this publication printed for the author \u2014 a fact about the paper, not about the person. Filled by scripts/fetch-affiliations.mjs from Crossref. Where it is absent the site falls back to the dated employment history in config/collaborators.json."
        }
      },
      "oneOf": [
        {
          "required": [
            "family",
            "given"
          ],
          "not": {
            "required": [
              "literal"
            ]
          }
        },
        {
          "required": [
            "literal"
          ]
        }
      ]
    },
    "authors": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/author"
      }
    },
    "venue": {
      "description": "BibTeX-native field names, so the mapping to a .bib entry is direct rather than translated.",
      "type": "object",
      "additionalProperties": false,
      "dependentRequired": { "month": ["year"] },
      "properties": {
        "journal": {
          "type": "string"
        },
        "year": {
          "type": "string",
          "pattern": "^[0-9]{4}$",
          "description": "The issue's year, where it differs from date.start — BibTeX uses it."
        },
        "month": {
          "type": "string",
          "pattern": "^(0[1-9]|1[0-2])$",
          "description": "The issue's month, where it differs from date.start — BibTeX uses it. Used only with venue.year."
        },
        "booktitle": {
          "type": "string",
          "description": "For @inproceedings / @incollection."
        },
        "publisher": {
          "type": "string"
        },
        "school": {
          "type": "string",
          "description": "For @phdthesis."
        },
        "series": {
          "type": "string"
        },
        "volume": {
          "type": "string"
        },
        "number": {
          "type": "string",
          "description": "Issue number — BibTeX calls it `number`."
        },
        "pages": {
          "type": "string"
        },
        "address": {
          "type": "string"
        }
      }
    },
    "amount": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "currency",
        "value"
      ],
      "properties": {
        "currency": {
          "enum": [
            "USD",
            "CAD",
            "EUR",
            "GBP"
          ]
        },
        "value": {
          "type": "number",
          "minimum": 0
        },
        "valueMax": {
          "description": "Upper bound, for an award quoted as a range. `value` is then the lower bound.",
          "type": "number",
          "minimum": 0
        },
        "perAnnum": {
          "type": "boolean",
          "default": false
        }
      }
    },
    "doi": {
      "type": "string",
      "pattern": "^10\\.\\d{4,9}/\\S+$",
      "description": "Bare DOI, no https://doi.org/ prefix."
    },
    "bibcode": {
      "type": "string",
      "pattern": "^\\d{4}[A-Za-z0-9.&+]{15}$",
      "description": "The 19-character ADS bibcode, e.g. 2022ApJ...935..167A. Omit until the paper is on ADS. The ADS URL derives from it, so no link entry is needed."
    }
  }
}
