{
  "id": "dedicated-delete",
  "name": "Delete the disposable Dedicated cluster",
  "risk": "mutating",
  "completionMutation": { "guardId": "dedicated-delete", "recoveryPath": "/tidbs" },
  "start": { "path": "/tidbs/{{dedicatedClusterId}}/overview" },
  "goal": [
    "Permanently delete only the verified Dedicated cluster {{clusterName}} that the runtime opened from its captured resource identity, and enter the exact confirmation text shown by the dialog.",
    "Finish when the loaded list no longer contains {{clusterName}}."
  ],
  "success": {
    "evidence": [
      { "kind": "url", "matches": "/(?:tidbs|clusters)(?:[/?]|$)" },
      { "kind": "testIdLoaded", "testId": "my-tidb-list-table-container", "timeoutMs": 60000 },
      { "kind": "absentText", "matches": "^{{clusterName}}$" }
    ]
  },
  "recovery": ["After one accepted delete request, only observe; if the exact cluster is already absent, do nothing."],
  "limits": { "maxDurationMs": 240000, "maxActions": 16 },
  "safety": {
    "requiredResourceIdentityVariable": "dedicatedClusterId",
    "deny": ["Do not delete a differently named cluster or modify another resource."],
    "networkGuards": [
      {
        "id": "dedicated-delete",
        "method": "DELETE",
        "pathMatches": "^/api/v1/orgs/[^/]+/projects/[^/]+/clusters/{{dedicatedClusterId}}$",
        "pageMustContain": ["{{clusterName}}"],
        "maxRequests": 1,
        "resourceIdentity": {
          "requestPathMatches": "^/api/v1/orgs/[^/]+/projects/[^/]+/clusters/([^/]+)$",
          "capturedVariable": "dedicatedClusterId"
        }
      }
    ]
  }
}
