{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raccoonflow.ai/evidence.schema.json",
  "title": "Raccoon Flow Evidence Schema",
  "description": "Public data contract for reusable evidence objects that support claims, reviews, vault profiles, and rating confidence.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "evidenceId",
    "type",
    "status",
    "subject",
    "issuer",
    "observedAt",
    "freshness",
    "confidence"
  ],
  "properties": {
    "schema": {
      "const": "raccoonflow.evidence.v0.1"
    },
    "evidenceId": {
      "type": "string",
      "pattern": "^rfev_[a-z0-9_]+$"
    },
    "type": {
      "type": "string",
      "enum": [
        "Wallet Signature",
        "Venue Account Proof",
        "DNS TXT Record",
        "Website File",
        "Email Domain Proof",
        "GitHub Proof",
        "Social Proof",
        "Execution Control Proof",
        "Data Freshness Proof",
        "Attestation",
        "Manual Review Artifact"
      ]
    },
    "status": {
      "type": "string",
      "enum": ["Missing", "Submitted", "Verified", "Rejected", "Expired", "Revoked"]
    },
    "subject": {
      "type": "object",
      "additionalProperties": false,
      "required": ["type", "name"],
      "properties": {
        "type": {
          "type": "string",
          "enum": ["Owner", "Agent", "Vault", "Venue Account", "Wallet", "Execution Controls", "Data Source"]
        },
        "name": {
          "type": "string"
        },
        "profileUrl": {
          "type": "string",
          "format": "uri"
        },
        "walletAddress": {
          "type": "string"
        },
        "venueName": {
          "type": "string"
        }
      }
    },
    "issuer": {
      "type": "object",
      "additionalProperties": false,
      "required": ["type", "name"],
      "properties": {
        "type": {
          "type": "string",
          "enum": ["Owner", "Venue", "Gateway", "Indexer", "Raccoon Flow", "Third-party Reviewer", "Automated Check"]
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "adapterId": {
      "type": "string",
      "pattern": "^rfad_[a-z0-9_]+$"
    },
    "adapterUrl": {
      "type": "string",
      "format": "uri"
    },
    "observedAt": {
      "type": "string",
      "format": "date-time"
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time"
    },
    "freshness": {
      "type": "string",
      "enum": ["Fresh", "Stale", "Missing", "Not Applicable"]
    },
    "confidence": {
      "type": "string",
      "enum": ["Low", "Medium", "High"]
    },
    "artifact": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "hash": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "signature": {
          "type": "string"
        },
        "redacted": {
          "type": "boolean"
        }
      }
    },
    "linkedObjects": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["type", "id"],
        "properties": {
          "type": {
            "type": "string",
            "enum": ["Claim", "Review", "Vault Profile", "Rating", "Agent", "Owner"]
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    },
    "notes": {
      "type": "string"
    }
  }
}
