{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/Sharathvc23/forgetproof/main/schemas/well-known.schema.json",
  "title": "forgetproof well-known document",
  "description": "What a hosted personal-agent provider serves at GET /.well-known/forgetproof.json: the key its receipts are signed with, the stores it holds, where to send a forget request, and what it can promise. A verifier checks a receipt's `public_key` against `public_key` or any `keys[].public_key` here before trusting the signature.",
  "type": "object",
  "properties": {
    "forgetproof": {
      "description": "The version of this document and of the receipts the provider issues.",
      "type": "string",
      "enum": ["0.2"]
    },
    "issuer": {
      "description": "The provider's name, as it appears in the `issuer` field of its receipts.",
      "type": "string",
      "minLength": 1
    },
    "public_key": {
      "description": "The current receipt-signing key: raw 32-byte Ed25519 public key, base64url without padding.",
      "$ref": "#/$defs/public_key"
    },
    "key_fingerprint": {
      "description": "First 32 hex characters of SHA-256 over the raw public key bytes; what people compare by eye.",
      "$ref": "#/$defs/fingerprint"
    },
    "keys": {
      "description": "Every key whose receipts should still verify, including the current one and rotated-out predecessors.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "public_key": { "$ref": "#/$defs/public_key" },
          "key_fingerprint": { "$ref": "#/$defs/fingerprint" },
          "valid_from": { "type": "string", "format": "date-time" }
        },
        "required": ["public_key", "key_fingerprint"],
        "additionalProperties": false
      }
    },
    "stores": {
      "description": "The stores a forget request covers.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,64}$" },
          "kind": { "type": "string", "enum": ["chroma", "sqlite", "postgres", "mem0", "qdrant", "lancedb", "files", "api"] }
        },
        "required": ["name", "kind"],
        "additionalProperties": false
      }
    },
    "endpoints": {
      "description": "Where to send a forget request, poll its status, and fetch receipts. Absolute URLs or paths relative to the origin.",
      "type": "object",
      "properties": {
        "forget": { "$ref": "#/$defs/endpoint" },
        "status": { "$ref": "#/$defs/endpoint" },
        "receipts": { "$ref": "#/$defs/endpoint" }
      },
      "required": ["forget", "status", "receipts"],
      "additionalProperties": { "$ref": "#/$defs/endpoint" }
    },
    "capabilities": {
      "description": "What the provider can do. A provider without verify_on_disk issues UNVERIFIABLE receipts, which never read as clean.",
      "type": "object",
      "properties": {
        "erase": { "type": "boolean", "description": "Erases on request, rather than only recording it." },
        "verify_on_disk": { "type": "boolean", "description": "Scans the store's files after erasing and reports what remains." },
        "queue": { "type": "boolean", "description": "Accepts a request now and completes it later; status reports progress." },
        "live_delete": { "type": "boolean", "description": "Deletes from a running store without taking it offline." }
      },
      "required": ["erase", "verify_on_disk", "queue", "live_delete"],
      "additionalProperties": { "type": "boolean" }
    },
    "statement": {
      "description": "Optional plain-language statement of what a forget request does and does not cover.",
      "type": "string"
    }
  },
  "required": ["forgetproof", "issuer", "public_key", "key_fingerprint", "stores", "endpoints", "capabilities"],
  "additionalProperties": false,
  "$defs": {
    "public_key": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{43}$"
    },
    "fingerprint": {
      "type": "string",
      "pattern": "^[0-9a-f]{32}$"
    },
    "endpoint": {
      "description": "An absolute URL, a path relative to the origin, or an RFC 6570 URI template such as /receipts/{id}.",
      "type": "string",
      "minLength": 1,
      "format": "uri-template"
    }
  },
  "examples": [
    {
      "forgetproof": "0.2",
      "issuer": "Pim Cloud",
      "public_key": "H5HcybllX8T0JfSfNJ5AJ2jhFfqSnRj0ibEjf6_AcwM",
      "key_fingerprint": "f19ea5a2ecffcb259fa5b96e33ae0ded",
      "keys": [
        {
          "public_key": "H5HcybllX8T0JfSfNJ5AJ2jhFfqSnRj0ibEjf6_AcwM",
          "key_fingerprint": "f19ea5a2ecffcb259fa5b96e33ae0ded",
          "valid_from": "2026-11-01T00:00:00Z"
        }
      ],
      "stores": [
        { "name": "memory", "kind": "chroma" },
        { "name": "notes", "kind": "sqlite" }
      ],
      "endpoints": {
        "forget": "/api/forgetproof/forget",
        "status": "/api/forgetproof/status/{id}",
        "receipts": "/api/forgetproof/receipts/{id}"
      },
      "capabilities": {
        "erase": true,
        "verify_on_disk": true,
        "queue": true,
        "live_delete": false
      },
      "statement": "A forget request removes the subject's values from the agent's memory and notes, then scans both stores on disk. Nightly backups are listed on the receipt as copies we cannot reach."
    }
  ]
}
