{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://getzero.dev/contracts/zero.deed_manifest.v0.schema.json",
  "title": "Deed discovery manifest (v0 draft)",
  "description": "The discovery card served at /.well-known/deed.json once the Stage-1 flip is armed (it answers 404 before that). v0 is a draft shape: staged blocks (signature, cli, mandate, registries) state what exists today and no more, and the card carries no census figures. The signed-manifest law and the final block layout are decided with the flip pack (PR #942) and the mandate spec.",
  "type": "object",
  "required": [
    "schema",
    "manifest_version",
    "identity",
    "signature",
    "endpoints",
    "floor",
    "verify",
    "cli",
    "skills",
    "mandate",
    "registries",
    "docs"
  ],
  "properties": {
    "schema": {
      "type": "string",
      "pattern": "/contracts/zero\\.deed_manifest\\.v0\\.schema\\.json$"
    },
    "manifest_version": { "const": "zero.deed_manifest.v0" },
    "identity": {
      "type": "object",
      "required": ["name", "origin", "statement"],
      "additionalProperties": false,
      "properties": {
        "name": { "const": "Deed" },
        "origin": { "type": "string", "pattern": "^https?://" },
        "statement": { "type": "string", "minLength": 1 }
      }
    },
    "signature": {
      "type": "object",
      "required": ["status", "note"],
      "additionalProperties": false,
      "properties": {
        "status": {
          "const": "staged",
          "description": "v0 is honest about being unsigned. A future version replaces this block with a detached signature and a published verifying key; an unsigned card is never passed off as signed."
        },
        "note": { "type": "string" }
      }
    },
    "endpoints": {
      "type": "object",
      "required": ["mcp"],
      "additionalProperties": false,
      "properties": {
        "mcp": {
          "type": "object",
          "required": ["public", "operator"],
          "additionalProperties": false,
          "properties": {
            "public": {
              "type": "object",
              "required": ["url", "auth", "can_execute_orders", "can_mutate_runtime_state"],
              "additionalProperties": true,
              "properties": {
                "url": { "type": "string", "pattern": "^https?://" },
                "auth": { "const": "none" },
                "can_execute_orders": { "const": false },
                "can_mutate_runtime_state": { "const": false }
              }
            },
            "operator": {
              "type": "object",
              "required": ["url", "auth"],
              "additionalProperties": true,
              "properties": {
                "url": { "type": "string", "pattern": "^https?://" },
                "auth": { "type": "string", "minLength": 1 }
              }
            }
          }
        }
      }
    },
    "floor": {
      "type": "object",
      "required": ["authority", "verbs", "note"],
      "additionalProperties": false,
      "properties": {
        "authority": { "type": "string", "minLength": 1 },
        "verbs": {
          "type": "array",
          "items": { "enum": ["spectate", "verify"] },
          "minItems": 2,
          "description": "The two evidence-open rungs. Authority above the floor requires a signed grant; no header earns it."
        },
        "note": { "type": "string" }
      }
    },
    "verify": {
      "type": "object",
      "required": ["quickstart", "negotiation"],
      "additionalProperties": false,
      "properties": {
        "quickstart": {
          "type": "array",
          "items": { "type": "string" },
          "minItems": 1,
          "description": "Fetch one proof, check it offline — no account, no API key."
        },
        "negotiation": { "type": "string" }
      }
    },
    "cli": {
      "type": "object",
      "required": ["crate", "status", "note"],
      "additionalProperties": false,
      "properties": {
        "crate": { "const": "deed" },
        "status": {
          "const": "staged",
          "description": "The install block renders only when the command is real — v0 pins the staged state; a published crate mints v1."
        },
        "note": { "type": "string" }
      }
    },
    "skills": {
      "type": "object",
      "required": ["manifest", "onboarding"],
      "additionalProperties": false,
      "properties": {
        "manifest": { "type": "string", "pattern": "^https?://" },
        "onboarding": { "type": "string", "pattern": "^https?://" }
      }
    },
    "mandate": {
      "type": "object",
      "required": ["status", "request_endpoint", "note"],
      "additionalProperties": false,
      "properties": {
        "status": {
          "const": "staged",
          "description": "v0 pins the staged state: no request endpoint exists, nothing auto-grants. The request lane arrives with the mandate spec implementation, not before."
        },
        "request_endpoint": { "const": null },
        "note": { "type": "string" }
      }
    },
    "registries": {
      "type": "object",
      "required": ["status", "note"],
      "additionalProperties": false,
      "properties": {
        "status": { "const": "staged" },
        "note": { "type": "string" }
      }
    },
    "docs": {
      "type": "object",
      "required": ["agent_index", "compatibility_discovery"],
      "additionalProperties": false,
      "properties": {
        "agent_index": { "type": "string", "pattern": "/llms\\.txt$" },
        "compatibility_discovery": { "type": "string", "pattern": "/\\.well-known/zero\\.json$" }
      }
    }
  },
  "additionalProperties": false
}
