{
  "id": "AUDIT-GAP-002",
  "name": "DELETE emits a V2 audit head row",
  "description": "Regression case for the missing emitDeleteAuditV2 hook: PersistenceService.Delete now writes an Action=DELETE head row into _System_AuditLog. Creates an Account, deletes it, then reads /services/data/v63.0/admin/audit/log and asserts a DELETE row exists. Records survive post-delete because the head row refers to the record Id, not the row itself.",
  "scene": "audit_log",
  "object": "_System_AuditLog",
  "setup": [
    {
      "name": "create-account",
      "method": "POST",
      "endpoint": "/services/data/v63.0/sobjects/Account",
      "payload": {"Name": "Audit DELETE {timestamp}", "Industry": "Others"},
      "expected_status": 201,
      "id_var": "acct_id"
    },
    {
      "name": "delete-account",
      "method": "DELETE",
      "endpoint": "/services/data/v63.0/sobjects/Account/{acct_id}",
      "expected_status": 204
    }
  ],
  "method": "GET",
  "endpoint": "/services/data/v63.0/admin/audit/log?object=Account&recordId={acct_id}&limit=50",
  "expects": {"status_code": 200},
  "response_assertions": [
    {"field": "records.0.Action", "operator": "eq", "value": "DELETE"},
    {"field": "records.0.FieldName", "operator": "eq", "value": "__record__"}
  ],
  "priority": "P1"
}
