Skip to main content
Security, approvals, and advanced automation Level: Intermediate 11 min read

Canceling Staged Operations in FlightDeck: Zero-Impact Queue Discarding

How to safely discard pending staged operations and Change Sets in FlightDeck via MCP or the Desktop Approval Center without touching Apple's servers.

Published: 2026-11-04 • Last Updated: 2026-11-04 • Author: Kip Lawrence
Key MCP Tools: flightdeck_change_set_cancelflightdeck_operation_stage_cancelflightdeck_operation_stage_status

Overview: The Safe Discard Boundary

When an AI coding assistant drafts a release update, it might misinterpret your instructions, propose the wrong pricing tier, or prepare release notes for an unintended locale. In traditional automation scripts that execute immediately, stopping a bad request requires frantically killing terminal processes or racing to the App Store Connect web portal to undo damage.

In FlightDeck, pending mutations live inside an isolated local staging queue before execution. Until you grant explicit approval in the Desktop Approval Center, zero network calls are dispatched to Apple.

TEXT
┌─────────────────────────────────────────────────────────────────────────────┐
│                 CANCELLATION AT DIFFERENT LIFECYCLE STATES                  │
├─────────────────────────────────────────────────────────────────────────────┤
│ 1. AI CHAT PLAN (Unstaged)          -> Tell AI to stop. Zero effect.        │
│ 2. STAGED IN FLIGHTDECK (Pending)   -> CANCEL via MCP or UI [ZERO APPLE HIT]│
│ 3. APPROVED (Awaiting Execution)    -> CANCEL via UI or TTL [ZERO APPLE HIT]│
│ 4. ACTIVELY EXECUTING (In-Flight)   -> Network in transit   [CANNOT CANCEL] │
│ 5. COMMITTED TO APPLE (Consumed)    -> Applied on Apple     [IRREVERSIBLE]  │
│ 6. AMBIGUOUS NETWORK FAILURE        -> Unknown Apple state  [READBACK REQ]  │
└─────────────────────────────────────────────────────────────────────────────┘

This guide explains how to discard or cancel pending operations using both FlightDeck Desktop and MCP tools, traces the exact effect of cancellation across every lifecycle state, and demarcates the boundary between local staging cancellation and remote Apple review cancellation.


Cancellation Tools and Security Secrets

FlightDeck implements dedicated cancellation tooling both in the desktop user interface and directly over the Model Context Protocol (MCP):

  1. flightdeck_operation_stage_cancel: Cancels an individual staged mutation proposal or artifact selection request.
  2. flightdeck_change_set_cancel: Cancels a multi-operation Bounded Change Set.
  3. Desktop Approval Center "Reject" / "Discard": Interactive buttons in the macOS Flutter GUI that immediately discard the card and notify listeners.

The Unforgeable cancellationSecret

Whenever an AI assistant stages an operation or Change Set, FlightDeck generates a cryptographically secure, 256-bit unforgeable secret:

  • cancellationSecret: Returned in plaintext to the proposing MCP client in the initial staging response.
  • cancellationSecretHash: Only the SHA-256 hash of this secret is stored in FlightDeck's state.

When an MCP client attempts to cancel a proposal via flightdeck_change_set_cancel, FlightDeck validates the secret:

DART
if (cancellationSecret == null || !cs.verifyCancellationSecret(cancellationSecret)) {
  throw AuthorizationBoundaryViolationException(
    'Cancellation ownership verification failed: invalid cancellation secret.',
    reasonCode: 'OWNERSHIP_VIOLATION',
  );
}

This ensures that rogue processes or unrelated agents connected to the loopback server cannot cancel another client’s staged work. In contrast, the human developer operating FlightDeck Desktop can always discard any proposal using trusted UI action without needing to know the secret.


Lifecycle Breakdown: What Cancellation Means at Each State

The term "cancellation" has completely different technical implications depending on where an operation sits in the execution pipeline:

1. Unstaged Plan in AI Chat

  • State: The AI assistant drafted an outline or JSON payload in your editor chat, but has not yet called a FlightDeck staging tool.
  • Cancellation Action: Simply instruct the assistant to stop or ignore the draft.
  • Apple Impact: Zero. No tools were invoked.

2. Staged Awaiting Approval (pendingHumanReview)

  • State: The assistant invoked flightdeck_operation_stage or flightdeck_change_set_stage. The proposal sits in memory and local SQLite/file storage with a default 15-minute time-to-live (TTL).
  • Cancellation Action:
  • Via Desktop UI: Click Reject or Discard on the Approval Center card.
  • Via MCP: The assistant calls flightdeck_change_set_cancel(changeSetId: "...", cancellationSecret: "...").
  • FlightDeck State: Transitions to ChangeSetStatus.cancelled (or rejected). The execution secret is permanently destroyed. An AuditEvent.changeSetCancelled entry is recorded in audit.jsonl.
  • Apple Impact: Zero. No HTTP requests were ever made to api.appstoreconnect.apple.com.

3. Changes Requested (changesRequested)

  • State: You clicked "Request Changes" in the desktop UI and submitted feedback notes.
  • Cancellation Action: The proposal is already in an immutable terminal state (isTerminal == true). It is effectively closed and non-executable.
  • Apple Impact: Zero.

4. Approved Awaiting Execution (approved)

  • State: You clicked "Approve" in FlightDeck Desktop, but the assistant has not yet dispatched flightdeck_change_set_execute.
  • Cancellation Action: By state machine rules (canTransitionTo), MCP clients cannot transition an already approved proposal to cancelled via flightdeck_change_set_cancel (an attempt throws ChangeSetTransitionException). However, the human operator can discard the proposal in the Desktop UI, or allow the 15-minute TTL to elapse (approved -> expired).
  • Apple Impact: Zero. No requests were sent to Apple, and the execution secret is permanently invalidated.

5. Actively Executing (In-Flight HTTPS)

  • State: The assistant called flightdeck_change_set_execute, and FlightDeck is streaming bytes over TLS 1.3 to Apple.
  • Cancellation Action: Cannot be safely canceled. Sockets cannot be interrupted mid-mutation without risking an ambiguous network outcome.
  • Apple Impact: Apple is actively processing the payload.

6. Completed Apple Mutation (consumed / allSucceeded)

  • State: Apple returned HTTP 200 OK, 201 Created, or 204 No Content.
  • Cancellation Action: Irreversible at the staging layer. Deleting the local audit record or discarding the completed Change Set has zero effect on Apple.
  • Apple Impact: The change is committed on Apple's production servers. If an unwanted version was created or release notes were changed, a compensating forward mutation (e.g. updating the notes again) or manual edit in App Store Connect is required.

7. Ambiguous Network Failure (ambiguous)

  • State: The request was sent, but the network connection timed out or dropped before receiving headers (AscAmbiguousNetworkException).
  • Cancellation Action: You cannot assume the request failed. Canceling the local record does not undo what Apple may have received.
  • Required Action: Run a read-only check (flightdeck_operation_stage_status or resource query) to inspect whether Apple processed the write.

Local Staging Cancellation vs. App Store Review Cancellation

A common source of confusion is the distinction between canceling a staged operation in FlightDeck and canceling a submission in App Store Connect:

Dimension FlightDeck Staged Cancellation Apple Review Cancellation (review_submission_cancel)
Target Resource Local memory / disk queue Remote Apple ReviewSubmission container
Scope Discards unapproved mutation drafts Withdraws an app version submitted for App Review
Tools Used flightdeck_change_set_cancel / UI button review_submission_cancel / Portal Resolution Center
Network Traffic Zero HTTP calls to Apple Sends PATCH /v1/reviewSubmissions/{id} to Apple
Permitted States Only while pendingHumanReview or approved Only while READY_FOR_REVIEW or WAITING_FOR_REVIEW
Irreversibility Safe local discard; can re-stage anytime Terminal on Apple; attached items return to draft

For details on withdrawing an in-flight App Store review submission, see Canceling an App Store Review Submission in Flight or Draft.


Step-by-Step Walkthrough: Discarding Staged Operations

Method A: One-Click Desktop UI Discard

  1. Bring FlightDeck Desktop to the front.
  2. In the Approval Center tab, locate the card you wish to discard.
  3. Inspect the payload. If you decide the operation is unnecessary or incorrect, click the red Reject (or Discard) button.
  4. An optional prompt allows you to provide a rejection reason (e.g. "Decided not to launch in Japanese storefront this sprint").
  5. The card immediately disappears from the pending queue. The proposing AI assistant is informed of the rejection on its next status check.

Method B: Conversational Prompting via AI Assistant

If you prefer to manage the cancellation from your IDE editor, instruct your assistant in plain English:

TEXT
I changed my mind about the Japanese localized release notes update. 
Cancel the pending staged Change Set in FlightDeck and do not send any changes to Apple. 
Confirm when the proposal has been discarded.

The assistant identifies the changeSetId and cancellationSecret from its session context, calls flightdeck_change_set_cancel, and confirms:

"The staged Change Set (cs_9f83a21b) has been cancelled in FlightDeck Desktop with reason: 'User requested cancellation'. Zero changes were sent to Apple, and the approval queue has been cleared."


Operational Safety Comparison

Feature FlightDeck Staging Cancellation Direct CLI / Script Abort (Ctrl+C)
Network Guarantees Provably zero packets sent to Apple Unknown; packet may already be on the wire
State Hygiene Clean state transition (cancelled); audit logged Leaves orphaned processes or socket leaks
Agent Awareness Agent receives explicit status: "CANCELLED" Agent crashes with broken pipe or timeout
Secret Invalidation Execution token cryptographically revoked Token may remain valid in local files

Troubleshooting Cancellation

"AuthorizationBoundaryViolationException: Invalid cancellation secret"

  • Cause: An AI assistant attempted to cancel a Change Set using an incorrect or missing secret.
  • Remedy: The assistant must pass the exact cancellationSecret returned by flightdeck_change_set_stage. If the assistant lost session state, simply click Discard in FlightDeck Desktop.

"ChangeSetTransitionException: Cannot transition from consumed"

  • Cause: Attempting to cancel a Change Set that has already executed and completed on Apple’s servers.
  • Remedy: Completed operations cannot be canceled. You must stage a new corrective operation or edit the resource in App Store Connect.

Staged Item Stays in Queue After Quitting IDE

  • Cause: Staged operations live in FlightDeck Desktop's local database, independent of your IDE editor window.
  • Remedy: Open FlightDeck Desktop and click Reject on the card, or wait for the 15-minute TTL to expire automatically.

Connect Your AI Agent to App Store Connect

FlightDeck runs locally on your Mac, keeping private keys secure in your macOS Keychain and executing mutations only after your explicit approval.

Download FlightDeck on Mac App Store