{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://oosl.org/schema/maintainer-1.json",
  "title": "Maintainer Profile",
  "description": "What a project publishes about itself, so that 'give where it is needed' becomes computable. DRAFT 0.1. Deliberately small: every field asked for is a field somebody has to keep up to date.",
  "type": "object",
  "required": ["format", "name", "structure", "maintainers", "updated"],
  "additionalProperties": true,
  "properties": {
    "format": { "type": "string", "const": "maintainer/0.1" },

    "name":    { "type": "string", "description": "The maintaining entity, not the product." },
    "url":     { "type": "string", "format": "uri" },
    "contact": { "type": "string", "description": "mailto: or https: URI." },

    "structure": {
      "description": "Licence s.5.1. What kind of thing is behind this software.",
      "type": "string",
      "enum": ["for-profit", "not-for-profit", "foundation", "government",
               "unincorporated", "individual"]
    },

    "maintainers": {
      "description": "Bands, never headcount, and never names. Headcount is employment information; a band answers the only question a licensee actually has.",
      "type": "object",
      "required": ["band"],
      "properties": {
        "band": {
          "type": "string",
          "enum": ["1", "2-5", "6-20", "21-100", "100+"]
        },
        "paid": {
          "description": "Is anyone paid to maintain this?",
          "type": "string",
          "enum": ["none", "some", "all"]
        },
        "seeking_maintainers": { "type": "boolean" }
      }
    },

    "funding": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": ["none", "donations", "grant", "commercial", "corporate-backed", "endowed"]
        },
        "sufficient": {
          "description": "Self-assessed: does current funding cover the work being asked of you? The most useful field here, and the one people find hardest to fill in honestly.",
          "type": "string",
          "enum": ["no", "partly", "yes"]
        },
        "channels": {
          "type": "array",
          "description": "Where contributions can go. Existing channels only; this project runs no payment rail and never will.",
          "items": {
            "type": "object",
            "required": ["url"],
            "properties": {
              "kind": { "type": "string",
                "enum": ["github-sponsors", "open-collective", "tidelift", "thanks-dev",
                         "liberapay", "ko-fi", "patreon", "invoice", "bank", "other"] },
              "url":  { "type": "string", "format": "uri" },
              "note": { "type": "string" }
            }
          }
        },
        "non_monetary": {
          "description": "What would help that is not money. Frequently the honest answer.",
          "type": "array",
          "items": { "type": "string",
            "enum": ["triage", "code-review", "documentation", "testing", "translation",
                     "security-review", "infrastructure", "employment", "nothing"] }
        }
      }
    },

    "products": {
      "description": "What this entity maintains, so a crawler can join a dependency tree to this profile.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name":    { "type": "string" },
          "purl":    { "type": "string", "description": "Package URL, version omitted, e.g. pkg:npm/sharp" },
          "repo":    { "type": "string", "format": "uri" },
          "licence": { "type": "string", "description": "SPDX expression." },
          "status":  { "type": "string", "enum": ["active", "maintenance", "seeking-maintainer", "deprecated", "archived"] }
        }
      }
    },

    "declaration": {
      "type": "string", "format": "uri",
      "description": "Optional. If this entity is also a licensee, its own give-back declaration. Most are both."
    },

    "updated": {
      "type": "string", "format": "date",
      "description": "A profile that has not been touched in years is itself a signal, and an intentional one."
    }
  }
}
