{
  "format_version": 1,
  "acc_version": 1,
  "specification_release": "1.0.1",
  "vectors": [
    {
      "id": "T-PARSE-01",
      "profile": "parser",
      "kind": "declaration",
      "assertion": "A minimal ACC v1 declaration is valid.",
      "input": { "declaration": { "version": 1, "enabled": true, "scope": "order.read" } },
      "expected": { "valid": true }
    },
    {
      "id": "T-PARSE-02",
      "profile": "parser",
      "kind": "declaration",
      "assertion": "A declaration without scope is invalid.",
      "input": { "declaration": { "version": 1, "enabled": true } },
      "expected": { "valid": false, "diagnostic": "invalid_declaration" }
    },
    {
      "id": "T-PARSE-03",
      "profile": "parser",
      "kind": "declaration",
      "assertion": "An unsupported major version is rejected or skipped with diagnostics.",
      "input": { "declaration": { "version": 2, "enabled": true, "scope": "order.read" } },
      "expected": { "valid": false, "diagnostic": "unsupported_version" }
    },
    {
      "id": "T-PARSE-04",
      "profile": "parser",
      "kind": "declaration",
      "assertion": "An unknown field is ignored without making the declaration invalid.",
      "input": { "declaration": { "version": 1, "enabled": true, "scope": "order.read", "x_future_hint": true } },
      "expected": { "valid": true }
    },
    {
      "id": "T-PARSE-05",
      "profile": "parser",
      "kind": "declaration",
      "assertion": "A declaration without a version is invalid rather than classified as an unsupported version.",
      "input": { "declaration": { "enabled": true, "scope": "order.read" } },
      "expected": { "valid": false, "diagnostic": "invalid_declaration" }
    },
    {
      "id": "T-EXPOSE-01",
      "profile": "runtime",
      "kind": "exposure",
      "assertion": "A disabled capability is not exposed.",
      "input": { "declaration": { "version": 1, "enabled": false, "scope": "order.read" }, "scope_allowed": true, "trusted_subject": true },
      "expected": { "exposed": false }
    },
    {
      "id": "T-EXPOSE-02",
      "profile": "runtime",
      "kind": "exposure",
      "assertion": "A subject-required capability is not exposed without a trusted subject.",
      "input": { "declaration": { "version": 1, "enabled": true, "scope": "order.read", "subject": { "required": true } }, "scope_allowed": true, "trusted_subject": false },
      "expected": { "exposed": false }
    },
    {
      "id": "T-EXPOSE-03",
      "profile": "runtime",
      "kind": "exposure",
      "assertion": "A capability outside the runtime scope policy is not exposed.",
      "input": { "declaration": { "version": 1, "enabled": true, "scope": "refund.create" }, "scope_allowed": false, "trusted_subject": true },
      "expected": { "exposed": false }
    },
    {
      "id": "T-EXPOSE-04",
      "profile": "runtime",
      "kind": "exposure",
      "assertion": "An enabled and allowed capability with required subject available is exposed.",
      "input": { "declaration": { "version": 1, "enabled": true, "scope": "order.read", "subject": { "required": true } }, "scope_allowed": true, "trusted_subject": true },
      "expected": { "exposed": true }
    },
    {
      "id": "T-APPROVAL-01",
      "profile": "runtime",
      "kind": "approval",
      "assertion": "approval.required true creates approval intent even when a condition does not match.",
      "input": {
        "declaration": { "version": 1, "enabled": true, "scope": "refund.create", "approval": { "required": true, "when": [{ "param": "amount", "op": ">", "value": 1000 }] } },
        "parameter_schema": { "type": "object", "properties": { "amount": { "type": "number" } }, "required": ["amount"] },
        "args": { "amount": 10 }
      },
      "expected": { "decision": "approval_required" }
    },
    {
      "id": "T-APPROVAL-02",
      "profile": "runtime",
      "kind": "approval",
      "assertion": "The first matching approval.when item is sufficient under ANY semantics.",
      "input": {
        "declaration": { "version": 1, "enabled": true, "scope": "refund.create", "approval": { "when": [{ "param": "amount", "op": ">", "value": 1000 }, { "param": "priority", "op": "==", "value": "urgent" }] } },
        "parameter_schema": { "type": "object", "properties": { "amount": { "type": "number" }, "priority": { "type": "string" } }, "required": ["amount", "priority"] },
        "args": { "amount": 1500, "priority": "normal" }
      },
      "expected": { "decision": "approval_required" }
    },
    {
      "id": "T-APPROVAL-03",
      "profile": "runtime",
      "kind": "approval",
      "assertion": "A later matching approval.when item is sufficient under ANY semantics.",
      "input": {
        "declaration": { "version": 1, "enabled": true, "scope": "refund.create", "approval": { "when": [{ "param": "amount", "op": ">", "value": 1000 }, { "param": "priority", "op": "==", "value": "urgent" }] } },
        "parameter_schema": { "type": "object", "properties": { "amount": { "type": "number" }, "priority": { "type": "string" } }, "required": ["amount", "priority"] },
        "args": { "amount": 10, "priority": "urgent" }
      },
      "expected": { "decision": "approval_required" }
    },
    {
      "id": "T-APPROVAL-04",
      "profile": "runtime",
      "kind": "approval",
      "assertion": "No conditional approval intent is created when no approval.when item matches.",
      "input": {
        "declaration": { "version": 1, "enabled": true, "scope": "refund.create", "approval": { "when": [{ "param": "amount", "op": ">", "value": 1000 }, { "param": "priority", "op": "==", "value": "urgent" }] } },
        "parameter_schema": { "type": "object", "properties": { "amount": { "type": "number" }, "priority": { "type": "string" } }, "required": ["amount", "priority"] },
        "args": { "amount": 10, "priority": "normal" }
      },
      "expected": { "decision": "allow" }
    },
    {
      "id": "T-APPROVAL-05",
      "profile": "runtime",
      "kind": "approval",
      "assertion": "An invocation value incompatible with its OpenAPI schema is rejected before condition evaluation.",
      "input": {
        "declaration": { "version": 1, "enabled": true, "scope": "refund.create", "approval": { "when": [{ "param": "amount", "op": ">", "value": 1000 }] } },
        "parameter_schema": { "type": "object", "properties": { "amount": { "type": "number" } }, "required": ["amount"] },
        "args": { "amount": "1500" }
      },
      "expected": { "decision": "reject_invalid_arguments" }
    },
    {
      "id": "T-APPROVAL-06",
      "profile": "runtime",
      "kind": "approval",
      "assertion": "An empty approval.when array creates no conditional approval intent.",
      "input": {
        "declaration": { "version": 1, "enabled": true, "scope": "refund.create", "approval": { "when": [] } },
        "parameter_schema": { "type": "object", "properties": { "amount": { "type": "number" } } },
        "args": { "amount": 1500 }
      },
      "expected": { "decision": "allow" }
    },
    {
      "id": "T-RISK-01",
      "profile": "runtime",
      "kind": "risk-default",
      "assertion": "A GET operation defaults to low risk when risk is omitted.",
      "input": { "declaration": { "version": 1, "enabled": true, "scope": "order.read" }, "http_method": "GET" },
      "expected": { "effective_risk": "low" }
    },
    {
      "id": "T-RISK-02",
      "profile": "runtime",
      "kind": "risk-default",
      "assertion": "A non-readonly write operation defaults to medium risk when risk is omitted.",
      "input": { "declaration": { "version": 1, "enabled": true, "scope": "order.update", "execution": { "readonly": false } }, "http_method": "POST" },
      "expected": { "effective_risk": "medium" }
    },
    {
      "id": "T-AUDIT-01",
      "profile": "runtime",
      "kind": "audit-hint",
      "assertion": "The broad audit sensitivity hint is preserved as true.",
      "input": { "declaration": { "version": 1, "enabled": true, "scope": "customer.read", "audit": { "sensitive": true } } },
      "expected": { "audit_sensitive": true }
    }
  ]
}
