# December Update: Preflight and Flake Shield

> November shipped preflight, which tests a workflow file before you push, Flake Shield for telling flaky tests from broken ones, and runs an agent can follow through to production.

Source: https://latchkey.dev/blog/preflight-and-flake-shield  
Kaveh Alemi  
Published 2026-12-01

**TL;DR** `latchkey preflight` runs a workflow file on your working tree before you push, and Flake Shield re-runs a failed test step to learn whether its tests are flaky without turning a red step green. Agents can now follow a run from pull request to deploy. Next, agents propose pipeline changes as pull requests.

## Shipped in November

- **`latchkey preflight`.** Run a workflow file on your working tree, the way Latchkey CI would run it, before you commit or push.
- **Flake Shield.** Self-heal can run a failed test step again to learn whether its tests are flaky, and the step stays red while it learns.
- **Runs an agent can follow and steer.** Find, wait on, re-run and cancel Latchkey CI runs by commit or pull request, from the CLI or over MCP, through to the deploy after a merge.
- **Checks that say what happened.** Job checks show while a job waits and runs, reach GitHub as each job ends, and say when self-heal kept a job green.
- **Merge queue support.** Latchkey CI builds each group a GitHub merge queue makes and writes the same checks there as on a pull request.
- **A Runs history you can search and export.** Search, filter and sort every run, export the history as CSV, download a job's log, and see what a held job is waiting for.
- **One-click spend approvals in AI Insight.** When a burst of jobs spends fast, the card's one approve sets that batch's budget or your spend limit.

Latchkey CI went live in October. November was about living with it every day: knowing a pipeline change works before you push it, knowing whether a red test is your change or a flaky test, and letting an agent see a change all the way through.

![Latchkey Ledger No. 12: Preflight and Flake Shield, November 2026](/blog/images/ledger-2026-12-cover.png)

## `latchkey preflight`

Until November, the only way to learn whether a workflow file worked was to push it and watch. For a person that costs a commit and a wait. For an agent editing a pipeline it costs worse: a string of "fix CI" commits on someone's pull request.

![latchkey preflight judges each job of a workflow file before any runner starts, then runs the working tree as it is now](/blog/images/ledger-2026-12-preflight.png)

**How you use it.** `latchkey preflight --workflow ci.yml --repository acme/api` runs the jobs of one workflow file, compiled exactly as Latchkey CI compiles it, on your working tree as it is now: uncommitted edits included, nothing pushed. Before any runner starts, Latchkey judges each job and says so: it runs as written, it runs its dry run, it is skipped by its own condition or for a job it needs, it fails before it starts, or it is not run, with the reason. Then the jobs that run, run, and the command ends with one verdict line.

**Why it works that way.** A preflight is a rehearsal, so it leaves no marks. It writes no check, opens no pull request, starts no self-heal and saves no cache entry. It is handed no secrets either, so a job that reads one is reported as not run rather than run without it. The exit code is built for scripts and agents: 0 only when a job ran and none failed or was left out, and 195 when everything that ran passed but something could not run.

**After a red run.** `latchkey preflight --only-failed-from <run>` runs only what did not succeed in an earlier run of the same file, plus the jobs those need, so the second try after a fix takes the time of the broken part, not the whole pipeline.

Preflight jobs bill like any other job. It needs a repository connected to Latchkey CI and an API key that can run jobs.

## Flake Shield

A test that fails and then passes at the same commit is flaky. A test that fails every time is broken. From a red check you cannot tell which, so most teams click re-run and hope, and a real failure that happens to pass on the second try gets merged.

![Flake Shield in Learn only: a test step fails, self-heal runs it again, compares the failing tests, and the step keeps its failure while the result is recorded](/blog/images/ledger-2026-12-flake.png)

**What it does.** Flake Shield is a setting under Settings, Self-healing, for owners and admins. It applies to test steps on Latchkey CI while self-heal is on, and it is off unless you turn it on. In **Learn only**, when a test step fails, self-heal can run that step again unchanged and compare which tests failed on each try. A test that fails and then passes on the re-run is recorded as flaky; one that fails again is not.

**What it deliberately does not do.** In Learn only, the step keeps its failure whatever the re-run shows. A red check stays red. What you gain is evidence instead of a guess: Latchkey records which failing tests proved flaky, by name and file, and how often.

**What it costs.** A re-run that leaves the step failed, as every Learn only re-run does, is not billed and draws nothing from your free minutes, up to as long as the job had run before it and, across all of a job's re-runs, half the time the job ran.

**Flaky is not fixed.** We also changed how every surface talks about re-runs. A job that passed because self-heal fixed something shows **Healed**. A job that passed only because a step was run again as written shows **Re-ran unchanged**, on the Runs page, on its checks, in `latchkey wait` and in the self-heal outcome report, which now counts flaky re-runs apart from fixes. To tell flaky from broken, Latchkey keeps the names and files of failing tests for 90 days.

## Runs an agent can follow and steer

An agent that opens a pull request needs to know more than whether one job passed. It needs to know whether the change landed and whether what ran after it worked. The CLI went from 0.9 to 0.21 in November, and most of that went into runs an agent can follow from start to finish.

![latchkey wait follows a pull request through its merge to the deploy run of the commit it landed as](/blog/images/ledger-2026-12-through.png)

- **Find runs by commit or pull request.** `latchkey workflows list --pr <number>` lists them, and `latchkey wait --commit <sha>` or `--pr <number>` waits on runs instead of single jobs, exiting 0 only when every one passed or was skipped.
- **Follow a change past its merge.** `latchkey wait --pr <number> --through deploy.yml` waits on the pull request's runs, then on the commit it landed as, then on that commit's run of your deploy file. It also follows a pull request merged through a merge queue to the push that landed it.
- **Steer a run.** `latchkey workflows run` starts a workflow file that declares `on: workflow_dispatch`. `latchkey workflows rerun` runs the jobs that did not pass again, with what needs them, as a new attempt at the same commit, and `latchkey workflows cancel` stops a run.
- **Know why something waits.** `latchkey status` names the run holding a job's concurrency group and about when it ends, and `latchkey schedule ls` lists what is held now and what your schedules start next.

Every one of these is also an MCP tool, and so are AI Insight's findings: an agent can list your workspace's open findings and read one with its evidence. When your workspace is near its runner limit, Latchkey CI jobs now start ahead of batches of agent jobs, as last issue promised, and `latchkey budget set --max-concurrent` caps how many of a batch's jobs run at once.

## Checks that say what happened

A check is the one place every reviewer already looks, so it should carry the news. A job's own check, such as `Latchkey / ci.yml / test`, now shows as queued while the job waits and in progress while it runs, and each job's result reaches GitHub when that job ends, not when the whole run does.

When self-heal kept a job green, the check says so in a sentence: "Self-heal fixed step 3, and it passed on a re-run." When a step passed only on a flaky re-run, it says that instead: "Self-heal judged step 3's failure flaky and re-ran the step unchanged, and it passed." That was the last of last issue's promises for self-heal, and it means a reviewer never has to open a log to learn that a green check had help.

## Merge queue support

Add `merge_group` to a workflow file's `on:` and Latchkey CI builds each group a GitHub merge queue makes, at the group's commit, and writes the same checks there as on a pull request. Each queued pull request is built again in its group, billed like any run, and a group the queue withdraws has its unfinished jobs cancelled. A group that no workflow file runs on gets a failing plan check, so a queue that requires it never merges a commit nothing built.

When the queue lands, the push to your default branch runs like any other push. If the group's run already covered that commit, the default branch gets a run of its own, with its own checks, so a deploy file that runs only on the default branch still runs.

## A Runs history you can search and export

The Runs page's **History** now has a search by pipeline, job, commit or ref, filters for repository, pipeline, branch, runner, result and who started it, and sorting, and every filter applies to the whole window, not just the page on screen. **Export CSV** saves the history as you have narrowed it, with each job's cost, and a job's detail has **Download log**. Job logs are now kept for 30 days, up from 7.

**Running now** lists held jobs beside running ones, and for a job waiting in a concurrency group it names the run holding the group. **TV mode** puts any dashboard page on a side monitor, full screen, refreshed every minute, with every notice that something is held or blocked.

## One-click spend approvals in AI Insight

An agent loop that fans out spends money faster than anyone reads a dashboard. AI Insight now raises a burst card when many jobs start within a few minutes under one batch or one API key: how many jobs, over how long, what they cost at list rates, and how many sit held at your limit right now.

The card has one action. Its button names a figure; the dialog says what that figure stops, and your confirm sets the batch's budget, or your workspace's spend limit for jobs started without a batch, to that figure. It can only lower a limit, never raise it, and it changes no file, so there is no pull request to review. This is the kind of insight we want more of: not a tip, but the one change, ready for your yes.

## Coming next

Last issue named three directions: an easier first run, agents that change pipelines the way people do, and speed and reliability. The third mostly shipped above. The other two are in motion:

- **Agents propose pipeline changes.** An agent will be able to propose a change to a workflow file, Latchkey will open the pull request, and the plan check will show what the change does to the pipeline, down to the jobs that start or stop running, before anyone merges. The merge is the approval.
- **Jobs that skip what a change cannot reach.** A job's `paths:` is already read and recorded; next, a job no changed path reaches will be skipped, on pull requests and on pushes.
- **An easier first run.** Migrate already offers a starter workflow file to a repository with no CI. Next, the dashboard will hand you one prompt to give your coding agent, and a repository that is not enabled will get a check that says why its job is waiting.
- **More of a migration done for you.** More Latchkey steps for the things migrations from GitHub Actions most often leave for a person to answer.

If there is a pipeline you want to move and something stops you, tell us through the [Support page](/support).

Previous issue: [November Update: Latchkey CI Is Live](/blog/latchkey-ci-is-live)

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
