{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.connectsoft.ai/reference/schemas/audit-evidence.schema.json",
  "title": "AuditEvidence (audit-evidence-v1)",
  "description": "Append-only, redacted record of a governance-relevant action (BC-19): approvals, cancellations, publications, policy denials, break-glass, exports, deletions, delegation changes. Retained 7 years (ADR-0019).",
  "type": "object",
  "required": ["evidenceId", "tenantId", "occurredAt", "actor", "action", "subject", "outcome", "chainHash"],
  "additionalProperties": false,
  "properties": {
    "evidenceId": { "type": "string", "format": "uuid" },
    "tenantId": { "type": "string" }, "projectId": { "type": "string" },
    "occurredAt": { "type": "string", "format": "date-time" },
    "actor": { "type": "object", "required": ["id", "kind"], "properties": { "id": { "type": "string" }, "kind": { "enum": ["user", "workload", "partner-agent", "system"] }, "roles": { "type": "array", "items": { "type": "string" } }, "delegatedFrom": { "type": "string" } } },
    "action": { "enum": ["approval-decided", "run-cancelled", "release-published", "release-revoked", "policy-denied", "break-glass", "export-requested", "deletion-requested", "delegation-granted", "delegation-revoked", "memory-promoted", "profile-published", "secret-issued", "tenant-region-changed"] },
    "subject": { "type": "object", "required": ["kind", "id"], "properties": { "kind": { "type": "string" }, "id": { "type": "string" }, "hash": { "type": "string", "description": "Hash of the exact object acted upon (for approvals: the proposal hash)." } } },
    "outcome": { "type": "string" },
    "reason": { "type": "string", "description": "Redacted; never contains content." },
    "policyDecisionId": { "type": "string", "format": "uuid" },
    "correlation": { "type": "object", "properties": { "runId": { "type": "string" }, "approvalId": { "type": "string" }, "eventId": { "type": "string" } } },
    "redactions": { "type": "array", "items": { "type": "string" }, "description": "Fields removed by classification rules." },
    "chainHash": { "type": "string", "description": "Hash over this record and the previous record's chainHash (tamper evidence)." }
  }
}
