{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://certiv.org/schema/certiv-manifest.schema.json",
  "title": "certiv claim manifest (certiv.yaml)",
  "description": "The file an author writes: which claims in a paper are checkable, and how each is recomputed. This is the single artifact certiv needs to verify a paper.",
  "type": "object",
  "required": ["schema", "paper", "tier", "claims"],
  "additionalProperties": true,
  "properties": {
    "schema": { "const": "certiv_manifest_v1" },
    "paper": {
      "type": "object",
      "required": ["title", "authors"],
      "properties": {
        "title": { "type": "string", "minLength": 1 },
        "authors": { "type": "array", "minItems": 1, "items": { "type": "string" } }
      }
    },
    "tier": { "enum": ["T0", "T1", "T2", "T3"], "description": "T1 open · T2 sealed container · T3 proof-carrying/private · T0 attested only" },
    "claims": {
      "type": "array", "minItems": 1,
      "items": {
        "type": "object",
        "required": ["id", "statement"],
        "properties": {
          "id": { "type": "string", "minLength": 1, "description": "stable slug used in paper text, diffs, and reviews" },
          "statement": { "type": "string", "minLength": 1, "description": "the checkable claim, as it appears in the paper" },
          "weight": { "enum": ["load_bearing", "supporting"], "default": "load_bearing" },
          "command": { "type": "string", "description": "shell command that recomputes the claim; mutually exclusive with certificate" },
          "inputs": { "type": "array", "items": { "type": "string" }, "description": "relative paths under the paper dir; hash-pinned at pack. No absolute paths, no ..; symlinks/non-regular files rejected." },
          "expect": {
            "type": "object",
            "description": "exactly one of: value(+tolerance) | stdout_sha256 | output_file+output_sha256. 'auto' pins the observed value at pack time.",
            "properties": {
              "value": { "type": "string" },
              "tolerance": { "type": "number" },
              "stdout_sha256": { "type": "string" },
              "output_file": { "type": "string" },
              "output_sha256": { "type": "string" }
            }
          },
          "certificate": {
            "type": "object",
            "description": "kernel-checkable artifact (e.g. a Lean proof); mutually exclusive with command",
            "required": ["path"],
            "properties": {
              "path": { "type": "string" },
              "checker": { "type": "string", "description": "command that checks the certificate; without it the claim is 'unverifiable', never verified" }
            }
          }
        },
        "oneOf": [
          { "required": ["command"] },
          { "required": ["certificate"] }
        ]
      }
    }
  }
}
