{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://vibebase.me/contracts/policy/0.2.0",
  "title": "PolicyDecisionRequest",
  "description": "단일 판단점(ADR-0002)에 묻는 어휘: 이 principal이 이 resource에 이 action을 해도 되는가. 응답은 decision.schema.json.",
  "type": "object",
  "additionalProperties": false,
  "required": ["principal", "resource", "action"],
  "properties": {
    "principal": { "$ref": "https://vibebase.me/contracts/principal/0.2.0" },
    "resource": {
      "type": "object",
      "additionalProperties": false,
      "required": ["type"],
      "properties": {
        "type": { "enum": ["document", "schema", "changeset", "capability"] },
        "id": { "type": "string", "minLength": 1 }
      }
    },
    "action": {
      "enum": [
        "document.read",
        "document.write",
        "schema.apply",
        "schema.rollback",
        "changeset.propose",
        "changeset.approve",
        "capability.invoke"
      ]
    },
    "context": { "type": "object" }
  }
}
