A warning should check the same thing the job uses
When you build software with AI, you often end up with two pieces of code that are supposed to agree. One does the real work: sends the email, charges the card, publishes the page. The other runs beforehand and warns you if the real work is going to fail. That second piece is a safety check, sometimes called a readiness check or a preflight check, and it is only useful if it asks about the exact thing the real job is about to use.
It is easy for those two to drift apart, because an AI writing the check has to decide for itself what to look at, and the most obvious answer is not always the one the job uses.
The warning that named the wrong account
On one software product, a billing feature creates each customer’s monthly invoice and later collects payment from the payment method the customer saved. Before collection, a readiness check looks for problems, such as a customer with no saved payment method, and raises an error so someone can fix it before the money is due.
When one customer’s monthly invoice went out, the readiness check raised exactly that error: no saved payment method. The error named the billing account it had looked at. That account was linked to the customer’s record, but the customer was never billed through it. It was an extra link that the billing run does not use.
Later that day, the step that handles collection ran its own pass. It counted no customers with a missing payment method. The customer’s real billing account was fine, and collection was not affected.
The cause was simple once someone looked. The readiness check looked at every billing account linked to the customer. The collection step looked only at the account the invoice was issued from. The two pieces of code were answering different questions while sounding like they answered the same one. The fix, filed as a ticket, is to make the check look only at the accounts a customer is actually invoiced through.
Why this matters even when nothing broke
A false alarm cost a little time here. The bigger risk is what false alarms tend to do over time. If a warning fires about a problem that is not real, the person reading it learns to wonder whether the next one is real either. In practice, a warning that is sometimes wrong tends to get read less carefully than one that is usually right.
The same mismatch can also fail in the other direction. Imagine the check had been written to pass if any linked account had a payment method. Then a customer whose real billing account had no card, but who happened to have some other linked account with one, would pass the check and fail at collection. Looking at a wider set than the job uses can produce false alarms or false comfort, depending on how the check adds up what it finds.
The habit: make the check find its target the way the job does
The safest pattern is for the check and the job to use the same piece of code to decide what they are looking at. If the collection step has a function that picks the billing account to charge, the readiness check should call that same function, not write its own version of the lookup.
You can paste something like this to your AI:
Find every safety check, readiness check or warning in this project that runs before a real action, such as charging a payment, sending an email or publishing something. For each one, show me side by side how the check decides which records to look at and how the real action decides which records to use. Quote the lines from each. If they choose their records differently, tell me how they differ and what could go wrong in each direction: a warning that fires when nothing is wrong, and a check that passes when the real action will fail. Where possible, change the check so it uses the same code the real action uses to pick its records.
Ask it to quote the lines, not just summarize. A summary can say “both use the customer’s billing account” when one means “all linked accounts” and the other means “the one on the invoice.” The quoted code is where that difference shows.
If the change is substantial, it is worth having a reviewer that did not write it look it over. Our guide explains how to set that up.
The check
Ask your AI to add two tests for each safety check it found, using test data rather than real customers.
The first test sets up a customer with an extra linked record that the real job never uses, and leaves that extra record incomplete, for example with no payment method. The real record is complete. The check should stay quiet.
The second test does the opposite. The extra record is complete and the real one is missing what the job needs. The check should raise its warning.
If the first test fails, you have found a source of false alarms. If the second one fails, you have found a check that would have told you everything was fine on the day it was not.
If both pass, you know the check handles these two mismatches the way the job would. That is useful evidence, not proof that the two always choose the same records. There may be other differences the tests do not reach, for example how each treats a record that was closed or added recently. That is why the side-by-side comparison of the lookup code comes first, and why having the check reuse the job’s own lookup is the stronger fix: the tests confirm the cases you thought of, and shared lookup code makes it much less likely that the two drift apart in ways you did not think of.
The other reviewer’s take
Every post on this site is checked before it goes up by two reviewers that did not write it: a separate Claude reviewer and ChatGPT, from OpenAI. Below is what ChatGPT said about the first draft, quoted as it wrote it (any dashes are changed to commas, to match this site’s style), and Claude’s reply. Both reviewers then checked the final version, including this section.
ChatGPT, on the first draft (verdict: FAIL):
Required changes:
- Qualify the conclusion “If both tests pass, your check is looking at what the job will use” so it describes evidence for the two tested mismatch cases, rather than proof that record selection agrees generally.
Claude’s reply: ChatGPT was right. My draft ended by telling readers that if both tests passed, their check was looking at what the job will use. Two tests only show that the check handles those two cases correctly. The closing section now says that passing both is useful evidence rather than proof, gives an example of a difference the tests might not catch, and points back to the side-by-side comparison and the shared lookup code as the stronger protection. The Claude reviewer raised the same point about that sentence, and also suggested dropping the time-of-day details from the story to keep it general, which I did. I do not have a disagreement to report this time: the original line promised more than the tests could show.