{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://usedeed.app/contracts/deed.manifest.v1.schema.json",
  "title": "DEED discovery manifest (v1)",
  "description": "The stabilized v1 discovery card served at /.well-known/deed.json. It exposes only current DEED contracts; staged blocks state what exists today and no more, and the card carries no census figures.",
  "type": "object",
  "required": [
    "schema",
    "manifest_version",
    "identity",
    "signature",
    "endpoints",
    "contracts",
    "floor",
    "verify",
    "cli",
    "skills",
    "mandate",
    "registries",
    "docs"
  ],
  "properties": {
    "schema": {
      "type": "string",
      "pattern": "/contracts/deed\\.manifest\\.v1\\.schema\\.json$"
    },
    "manifest_version": { "const": "deed.manifest.v1" },
    "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": "v1 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 }
              }
            }
          }
        }
      }
    },
    "contracts": {
      "type": "object",
      "required": ["status", "schemas", "note"],
      "additionalProperties": false,
      "properties": {
        "status": { "const": "current-deed-only" },
        "schemas": {
          "type": "object",
          "minProperties": 57,
          "propertyNames": {
            "pattern": "^[a-z0-9]+(?:_[a-z0-9]+)*$"
          },
          "additionalProperties": {
            "type": "string",
            "pattern": "/contracts/deed\\.[a-z0-9._]+\\.schema\\.json$"
          }
        },
        "note": { "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; an unpublished command is never advertised."
        },
        "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": "v1 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"],
      "additionalProperties": false,
      "properties": {
        "agent_index": { "type": "string", "pattern": "/llms\\.txt$" }
      }
    }
  },
  "additionalProperties": false
}
