{
  "id": "starter-delete",
  "name": "Delete the disposable Starter instance",
  "risk": "mutating",
  "completionMutation": { "guardId": "starter-delete", "recoveryPath": "/tidbs" },
  "start": { "path": "/tidbs/{{starterClusterId}}/overview" },
  "goal": [
    "Delete only the verified Starter instance {{clusterName}} that the runtime opened from its captured resource identity, and type the exact confirmation text shown by the dialog.",
    "If it is already absent, do nothing. Finish when the loaded list no longer contains it."
  ],
  "success": {
    "evidence": [
      { "kind": "url", "matches": "/tidbs(?:[/?]|$)" },
      { "kind": "testIdLoaded", "testId": "my-tidb-list-table-container", "timeoutMs": 60000 },
      { "kind": "absentText", "matches": "^{{clusterName}}$" }
    ]
  },
  "recovery": [
    "Operate only on the visible instance whose name exactly equals {{clusterName}}.",
    "After one accepted delete request, only observe; if already absent, do not open another instance menu."
  ],
  "safety": {
    "requiredResourceIdentityVariable": "starterClusterId",
    "deny": [
      "Do not delete a differently named instance.",
      "Do not create or update a resource or change billing, users, roles, or organization settings."
    ],
    "networkGuards": [
      {
        "id": "starter-delete",
        "method": "DELETE",
        "pathMatches": "^/api/v1/orgs/[^/]+/projects/[^/]+/clusters/{{starterClusterId}}$",
        "pageMustContain": ["{{clusterName}}"],
        "resourceIdentity": {
          "requestPathMatches": "^/api/v1/orgs/[^/]+/projects/[^/]+/clusters/([^/]+)$",
          "capturedVariable": "starterClusterId"
        },
        "maxRequests": 1
      }
    ]
  }
}
