{
  "slug": "toolkit-lib-deployresult-reports-resource-delete-failures-a93471b02618",
  "title": "toolkit-lib DeployResult reports resource delete failures",
  "tools": [
    "cdk"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-06-03T16:19:51.000Z",
  "announced_at": "2026-06-03T16:19:51.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When using toolkit-lib to deploy a stack, inspect `deleteFailures` on the successful stack result; it lists resources CloudFormation failed to delete during a stack update. [Source](https://github.com/aws/aws-cdk-cli/blob/aws-cdk%40v2.1126.0/packages/%40aws-cdk/toolkit-lib/lib/api/deployments/deployment-result.ts)",
    "examples": [
      "const result = await toolkit.deploy(...); // pass the deployment arguments required by your application\nfor (const stack of result.stackResults) {\n  if (stack.type === 'did-deploy-stack') {\n    for (const failure of stack.deleteFailures) {\n      // inspect failure\n    }\n  }\n}"
    ],
    "gotchas": [
      "Version: 2.1126.0",
      "deleteFailures (required): `ResourceDeleteFailure[]`; resources CloudFormation failed to delete during a stack update. Non-empty only when CloudFormation skipped deletion failures.",
      "DeployedStack (required): Not found as a documented type in the opened result file; it defines `SuccessfulDeployStackResult` with `deleteFailures`.",
      "This reports resource deletions CloudFormation failed to perform during a stack update."
    ]
  },
  "why_it_matters": "When programmatically deploying a stack that may leave resources undeleted, inspect the deployment result for CloudFormation delete failures.",
  "before": "Programmatic consumers of `toolkit-lib` and integration tests could not observe this condition; CloudFormation could silently skip a failed deletion after retries while marking the update successful.",
  "sources": [
    "https://github.com/aws/aws-cdk-cli/releases/tag/aws-cdk%40v2.1126.0",
    "https://github.com/aws/aws-cdk-cli/pull/1576",
    "https://github.com/aws/aws-cdk-cli/blob/aws-cdk%40v2.1126.0/packages/%40aws-cdk/toolkit-lib/lib/api/deployments/deployment-result.ts"
  ],
  "rank": 0.90027,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2a-20261017",
    "verdict_id": "wave2a-20261017:wave2a-20261017-73079bbf8c0b0f42-1:gate",
    "evidence_hash": "364f418b60b08c26842118b6224874a2f44c0faffc7c19dba6bd201ee13867a1"
  },
  "review": {
    "draft_hash": "0bb5cc8722f7a55a7fcd13eca183ec0c66115f9549714978ce60d7030aea4e5b",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2a-20261017:gate",
    "reason": "2 of 3 judge runs approved with p_yes >= 0.9 (mean 0.90 >= 0.9; 2 needed) and Jev gave 0.60 (>= 0.6 needed)."
  }
}
