{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://webgcp.org/schemas/manifest/v0.1.json",
  "$comment": "v0.1 stub schema. The full normative shape is currently specified in prose at https://webgcp.org/spec/v0.1/#section-5-2. This schema validates the top-level required fields only; field-level validation will be tightened in v0.2 after v0.1 implementation friction is captured. Until then, validate manifests by comparison with the worked example at https://the-ai-news.web.app/webgcp/manifests/news-kb-v0.1.json.",
  "title": "webGCP Manifest v0.1",
  "type": "object",
  "required": [
    "manifest_version",
    "kb",
    "purpose",
    "applicability",
    "inputs",
    "authority",
    "governance",
    "versioning"
  ],
  "properties": {
    "manifest_version": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
      "description": "Semver of the manifest schema this document validates against."
    },
    "kb": {
      "type": "object",
      "required": ["id", "owner", "status"],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^urn:webgcp:",
          "description": "Globally unique KB identifier in URN form."
        },
        "owner": {
          "type": "string"
        },
        "status": {
          "enum": ["active", "deprecated", "superseded"]
        }
      }
    },
    "purpose": {
      "type": "object",
      "required": ["summary"],
      "properties": {
        "summary": {"type": "string"},
        "declared_capabilities": {
          "type": "array",
          "items": {"type": "string"}
        }
      }
    },
    "applicability": {
      "type": "object",
      "properties": {
        "in_scope_when": {"type": "array"},
        "out_of_scope_when": {"type": "array"}
      }
    },
    "inputs": {
      "type": "object"
    },
    "authority": {
      "type": "object",
      "properties": {
        "canonical_sources": {"type": "array"},
        "freshness_sla": {
          "type": "string",
          "description": "ISO 8601 duration."
        }
      }
    },
    "governance": {
      "type": "object",
      "properties": {
        "pii_class": {
          "enum": ["none", "pseudonymous", "personal", "sensitive"]
        }
      }
    },
    "versioning": {
      "type": "object",
      "required": ["manifest_semver"],
      "properties": {
        "manifest_semver": {
          "type": "string",
          "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
        }
      }
    }
  }
}
