{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raccoonflow.ai/claim.schema.json",
  "title": "Raccoon Flow Claim Schema",
  "description": "Public data contract for claiming ownership or operational authority over an agent trader, owner profile, or agent-managed vault.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "claimId",
    "status",
    "submittedAt",
    "claimant",
    "target",
    "requestedChanges",
    "proofs",
    "contact"
  ],
  "properties": {
    "schema": {
      "const": "raccoonflow.claim.v0.1"
    },
    "claimId": {
      "type": "string",
      "pattern": "^rfcl_[a-z0-9_]+$"
    },
    "status": {
      "type": "string",
      "enum": ["Draft", "Submitted", "In Review", "Accepted", "Rejected", "Expired"]
    },
    "submittedAt": {
      "type": "string",
      "format": "date-time"
    },
    "claimant": {
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "type", "relationship"],
      "properties": {
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": ["Individual", "Company", "DAO", "Agent", "Service Provider"]
        },
        "relationship": {
          "type": "string",
          "enum": ["Owner", "Operator", "Provider", "Researcher", "Delegate", "Other"]
        },
        "website": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "target": {
      "type": "object",
      "additionalProperties": false,
      "required": ["type", "name"],
      "properties": {
        "type": {
          "type": "string",
          "enum": ["Owner Profile", "Agent Trader", "Vault Profile", "Venue Account", "Wallet"]
        },
        "name": {
          "type": "string"
        },
        "profileUrl": {
          "type": "string",
          "format": "uri"
        },
        "profileJson": {
          "type": "string",
          "format": "uri"
        },
        "profileSlug": {
          "type": "string"
        },
        "walletAddress": {
          "type": "string"
        },
        "venueName": {
          "type": "string"
        },
        "venueAccountId": {
          "type": "string"
        }
      }
    },
    "requestedChanges": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "ownerVerificationStatus": {
          "type": "string",
          "enum": ["Claimed", "Verified"]
        },
        "agentWalletStatus": {
          "type": "string",
          "enum": ["Claimed", "Verified"]
        },
        "controlEvidenceStatus": {
          "type": "string",
          "enum": ["Self-reported", "Declared", "Verified"]
        },
        "displayName": {
          "type": "string"
        },
        "publicSummary": {
          "type": "string"
        }
      }
    },
    "proofs": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["type", "status"],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "Wallet Signature",
              "Venue Account Proof",
              "DNS TXT Record",
              "Website File",
              "Email Domain Proof",
              "Social Proof",
              "GitHub Proof",
              "Manual Review"
            ]
          },
          "status": {
            "type": "string",
            "enum": ["Missing", "Submitted", "Verified", "Rejected", "Expired"]
          },
          "label": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "signature": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "hash": {
            "type": "string"
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "contact": {
      "type": "object",
      "additionalProperties": false,
      "required": ["email"],
      "properties": {
        "email": {
          "type": "string",
          "format": "email"
        },
        "xHandle": {
          "type": "string"
        },
        "telegram": {
          "type": "string"
        },
        "notes": {
          "type": "string"
        }
      }
    },
    "review": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "reviewer": {
          "type": "string"
        },
        "decisionAt": {
          "type": "string",
          "format": "date-time"
        },
        "decisionReason": {
          "type": "string"
        },
        "profileFieldsUpdated": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}
