Engineering notes
Evaluating AI Code Assistants: When to Trust LLMs in Production
By Muhammad Shahid · · 20 min read
Quick answer
Trust AI-generated code by what it survives, not by how it reads. In this article's test of eight bugs typical of generated code, strict TypeScript and ESLint caught none and the tests written alongside the code caught none, because they shared the code's assumptions. Hand-written edge-case tests and property-based tests caught all eight, and the property tests found the smallest failing input by themselves. Add mutation testing to check that the tests would notice a change, security checks for paths, input and dependencies, a human review of intent, and a guarded release.
| Stack | TypeScript, Vitest 4, fast-check 4, Stryker 9, typescript-eslint (strictTypeChecked) |
|---|---|
| Bugs | Eight seeded bugs of kinds common in generated code: off-by-one, rounding, dates, Unicode, paths, regex |
| Static checks | tsc --strict and ESLint strictTypeChecked: 0 of 8 caught |
| Tests | Tests written with the code: 0 of 8; edge cases: 8 of 8; property tests: 8 of 8 |
| Mutation | Stryker: tests noticed 57% of 173 code changes with the AI's tests, 65% with edge and property tests, 88% with bad-input tests |
AI coding assistants write code that compiles, reads well and passes the tests that come with it. That is exactly why its bugs reach production: they hide in the cases nobody wrote down. This article tests that claim instead of repeating it. It takes eight small functions written the way an assistant typically writes them, each with one bug of a kind that shows up often in AI-generated code, and measures which testing strategies catch them: strict types and lint, the tests written alongside the code, hand-written edge cases, property-based tests with fast-check, and mutation testing with Stryker. The bugs are seeded on purpose, so we know exactly what should be found; every number below comes from running the tests.
Why AI-generated code fails differently
A person who writes a bug usually writes a test that would miss it too, but at least they had the problem in their head. Generated code is fluent without that understanding: it looks like code that handles the problem, and the tests generated with it check the same assumptions the code makes. Common failure kinds are off-by-one errors in loops and pages, rounding and floating-point money, dates that do not exist, text outside the Latin alphabet, file paths from users, regular expressions that are too strict, and retry and timeout logic. None of these produce a type error, which is why the type checker is not enough.
The experiment
| Function | Bug | Kind |
|---|---|---|
| splitBill | Shares do not add up to the total | Rounding |
| paginate | Page 1 skips the first page | Off-by-one |
| parseDate | 30 February rolls over to March | Dates |
| slugify | Hebrew or Chinese titles become empty | Unicode |
| applyDiscount | Floating-point cents (17.991) | Money |
| safeFileName | "." and ".." get through | Paths and security |
| retry | One try too many | Off-by-one |
| isEmail | Valid addresses rejected | Regex |
The code the assistant wrote
// Code as an AI assistant typically writes it: it reads well, passes the obvious tests,
// and each function hides one bug from a class that shows up often in generated code.
// Split a bill in cents between people.
export function splitBill(totalCents: number, people: number): number[] {
const share = Math.round(totalCents / people);
return Array.from({ length: people }, () => share); // BUG: shares may not add up to the total
}
// Return one page of results; page numbers start at 1.
export function paginate<T>(items: T[], page: number, size: number): T[] {
return items.slice(page * size, page * size + size); // BUG: skips the first page
}
// Parse a YYYY-MM-DD date.
export function parseDate(s: string): Date | null {
if (!/^\d{4}-\d{2}-\d{2}$/.test(s)) return null;
const d = new Date(s + "T00:00:00Z");
return isNaN(d.getTime()) ? null : d; // BUG: 2026-02-30 becomes 2 March instead of null
}
// Turn a title into a URL slug.
export function slugify(title: string): string {
return title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""); // BUG: Hebrew or Chinese titles become ""
}
// Apply a percentage discount to a price in dollars.
export function applyDiscount(price: number, percent: number): number {
return price - price * (percent / 100); // BUG: floating point, e.g. 19.99 at 10% is 17.991
}
// Make a user-supplied file name safe to store under an uploads folder.
export function safeFileName(name: string): string {
return name.replace("../", "").replace(/[/\\]/g, "_"); // BUG: removes only the first "../", and "..": "...." survives
}
// Retry an async call; attempts is the total number of tries.
export async function retry<T>(fn: () => Promise<T>, attempts: number): Promise<T> {
let lastError: unknown;
for (let i = 0; i <= attempts; i++) { // BUG: one try too many
try {
return await fn();
} catch (err) {
lastError = err;
}
}
throw lastError;
}
// Check that a string looks like an email address.
export function isEmail(s: string): boolean {
return /^[a-z0-9._]+@[a-z0-9-]+\.[a-z]+$/.test(s); // BUG: rejects "Ann+news@mail.co.uk" and capitals
}
Each function is short, named well and commented, and each would pass a quick review. The bug comments are there for you; in real code they would not be.
The tests the assistant wrote
// The tests an assistant typically writes next to its own code: one typical input each,
// checking the shape of the answer more than the answer.
import { describe, expect, it } from "vitest";
import { impl } from "./impl";
describe("happy path", () => {
it("splits a bill", () => expect(impl.splitBill(1000, 4)).toEqual([250, 250, 250, 250]));
it("returns a full page", () => expect(impl.paginate([...Array(100).keys()], 2, 10)).toHaveLength(10));
it("parses a date", () => expect(impl.parseDate("2026-11-12")?.getUTCDate()).toBe(12));
it("slugifies a title", () => expect(impl.slugify("Hello World!")).toBe("hello-world"));
it("applies a discount", () => expect(impl.applyDiscount(100, 10)).toBe(90));
it("keeps a normal file name", () => expect(impl.safeFileName("report.pdf")).toBe("report.pdf"));
it("retries until it works", async () => {
let n = 0;
expect(await impl.retry(async () => { if (++n < 2) throw new Error("flaky"); return "ok"; }, 3)).toBe("ok");
});
it("checks emails", () => {
expect(impl.isEmail("ann@example.com")).toBe(true);
expect(impl.isEmail("not-an-email")).toBe(false);
});
});
These are typical generated tests: one ordinary input per function, often checking the shape of the result rather than its value ("a page has 10 items"). All eight pass against the buggy code. They are not useless, they catch crashes and obvious mistakes, but they cannot catch a bug in an assumption the code and the tests share.
What strict types and lint found
Nothing. The buggy file passes tsc --strict and ESLint with typescript-eslint's strictTypeChecked rules without a single warning. Types catch the wrong kind of value; these bugs are the right kind of value with the wrong amount, date or character. Keep the type checker and the linter, they are cheap, but do not count them as a review of generated logic.
Edge-case tests a reviewer writes
// Edge cases a careful reviewer writes by hand: each one needs someone to think of it.
import { describe, expect, it } from "vitest";
import { impl } from "./impl";
describe("edge cases", () => {
it("bill shares add up to the total", () => expect(impl.splitBill(1000, 3).reduce((a, b) => a + b, 0)).toBe(1000));
it("page 1 is the first page", () => expect(impl.paginate([1, 2, 3, 4, 5], 1, 2)).toEqual([1, 2]));
it("rejects 30 February", () => expect(impl.parseDate("2026-02-30")).toBeNull());
it("slugifies Hebrew", () => expect(impl.slugify("שלום עולם")).not.toBe(""));
it("discount has whole cents", () => expect(impl.applyDiscount(19.99, 10)).toBe(17.99));
it("never returns a parent-directory name", () => expect(impl.safeFileName("../..")).not.toBe(".."));
it("tries exactly the given number of times", async () => {
let n = 0;
await expect(impl.retry(async () => { n++; throw new Error("down"); }, 3, 0)).rejects.toThrow("down");
expect(n).toBe(3);
});
it("accepts plus addressing and capitals", () => expect(impl.isEmail("Ann+news@mail.co.uk")).toBe(true));
});
A reviewer who knows the domain writes these: shares that do not divide evenly, the first page, 30 February, a Hebrew title, a price with cents, a hostile file name, a service that is always down, a real-world email address. All eight fail against the buggy code. The catch is in the first sentence: each test needs someone to think of that case.
Property-based tests
// Property-based tests: state a rule that must hold for every input and let fast-check search for a breaking one.
import fc from "fast-check";
import { describe, expect, it } from "vitest";
import { impl } from "./impl";
const RUNS = { numRuns: 300, seed: 42 };
describe("properties", () => {
it("bill shares always add up to the total and differ by at most 1 cent", () =>
fc.assert(fc.property(fc.integer({ min: 0, max: 1_000_000 }), fc.integer({ min: 1, max: 50 }), (total, people) => {
const shares = impl.splitBill(total, people);
expect(shares.reduce((a, b) => a + b, 0)).toBe(total);
expect(Math.max(...shares) - Math.min(...shares)).toBeLessThanOrEqual(1);
}), RUNS));
it("all pages together give back every item exactly once", () =>
fc.assert(fc.property(fc.array(fc.integer(), { maxLength: 60 }), fc.integer({ min: 1, max: 10 }), (items, size) => {
const pages = Math.ceil(items.length / size);
const all = Array.from({ length: pages }, (_, i) => impl.paginate(items, i + 1, size)).flat();
expect(all).toEqual(items);
}), RUNS));
it("a parsed date has the same year, month and day as the text", () =>
fc.assert(fc.property(fc.integer({ min: 1900, max: 2100 }), fc.integer({ min: 1, max: 12 }), fc.integer({ min: 1, max: 31 }), (y, m, d) => {
const text = y + "-" + String(m).padStart(2, "0") + "-" + String(d).padStart(2, "0");
const date = impl.parseDate(text);
if (date) expect(date.toISOString().slice(0, 10)).toBe(text);
}), RUNS));
it("any title with a letter or digit gives a non-empty slug", () =>
fc.assert(fc.property(fc.string({ unit: "grapheme", minLength: 1 }).filter((s) => /[\p{L}\p{N}]/u.test(s)), (title) => {
expect(impl.slugify(title)).not.toBe("");
}), RUNS));
it("a slug never has a double dash or a dash at either end", () =>
fc.assert(fc.property(fc.string({ unit: "grapheme" }), (title) => {
expect(impl.slugify(title)).not.toMatch(/--|^-|-$/);
}), RUNS));
it("a discounted price is a whole number of cents", () =>
fc.assert(fc.property(fc.integer({ min: 0, max: 1_000_000 }), fc.integer({ min: 0, max: 100 }), (cents, pct) => {
const out = impl.applyDiscount(cents / 100, pct);
expect(Math.abs(out * 100 - Math.round(out * 100))).toBeLessThan(1e-6);
}), RUNS));
it("a safe file name has no separators and is never '.' or '..'", () =>
fc.assert(fc.property(fc.string({ unit: fc.constantFrom(".", "/", "\\", "a", "b", "_") }), (name) => {
const out = impl.safeFileName(name);
expect(out).not.toMatch(/[/\\]/);
expect([".", ".."]).not.toContain(out);
}), RUNS));
it("retry calls the function exactly the given number of times when it always fails", () =>
fc.assert(fc.asyncProperty(fc.integer({ min: 1, max: 5 }), async (attempts) => {
let n = 0;
await impl.retry(async () => { n++; throw new Error("x"); }, attempts, 0).catch(() => {});
expect(n).toBe(attempts);
}), RUNS));
it("every generated valid address is accepted", () =>
fc.assert(fc.property(fc.emailAddress(), (email) => {
expect(impl.isEmail(email)).toBe(true);
}), RUNS));
});
A property test states a rule that must hold for every input, then lets fast-check generate hundreds of inputs looking for one that breaks it. "All pages together give back every item exactly once" does not mention page 1, yet it finds the page-1 bug. "Shares always add up to the total" does not mention 1 cent split two ways, yet it finds it. When a property fails, fast-check shrinks the input to the smallest one that still fails, so the report is a readable bug, not a random blob. The seed is fixed so runs repeat exactly.
What fast-check found
FAIL bill shares always add up to the total and differ by at most 1 cent
Counterexample: [1,2]
FAIL all pages together give back every item exactly once
Counterexample: [[0],1]
FAIL a parsed date has the same year, month and day as the text
Counterexample: [1900,2,29]
FAIL any title with a letter or digit gives a non-empty slug
Counterexample: ["¹"]
FAIL a discounted price is a whole number of cents
Counterexample: [62501,1]
FAIL a safe file name has no separators and is never '.' or '..'
Counterexample: ["."]
FAIL retry calls the function exactly the given number of times when it always fails
Counterexample: [1]
FAIL every generated valid address is accepted
Counterexample: ["a@a.a.aa"]
Some of these are not the inputs a person would try first. 1900 was not a leap year, so 29 February 1900 does not exist, and the buggy parser quietly turned it into 1 March. A superscript "¹" is a digit in Unicode, and the ASCII-only slug code dropped it. 625.01 with a 1% discount gives 618.7599 in floating point. These are the bugs that reach production, because nobody thought of the input.
Are the tests themselves good? Mutation testing
{ "testRunner": "vitest", "vitest": { "configFile": "vitest.config.ts" }, "mutate": ["src/reviewed.ts"], "reporters": ["clear-text"], "concurrency": 2, "tempDirName": ".stryker-tmp-all" }
tests the assistant wrote only:
File | total | covered | # killed | # timeout | # survived | # no cov | # errors |
All files | 57.23 | 60.00 | 99 | 0 | 66 | 8 | 0 |
+ edge cases, properties and bad-input tests:
File | total | covered | # killed | # timeout | # survived | # no cov | # errors |
All files | 88.44 | 88.95 | 153 | 0 | 19 | 1 | 0 |
Catching the eight bugs proves the tests can fail; mutation testing asks whether they fail for the right reasons. Stryker made 173 small changes to the reviewed code, such as turning < into <=, deleting a condition or emptying a string, and ran the tests against each. With only the assistant's tests, 57% of the changes were noticed. Adding the edge cases and property tests, which caught every real bug, raised that only to 65%: none of the tests checked what happens with a negative amount, page 0, an empty file name or zero attempts, so the input checks could be deleted without any test failing. Eight bad-input tests and one more property raised the score to 88%.
// What mutation testing showed was missing: nothing checked how the functions treat bad input.
import { describe, expect, it } from "vitest";
import { impl } from "./impl";
describe("bad input", () => {
it("splitBill rejects negative, fractional and zero values", () => {
expect(() => impl.splitBill(-1, 2)).toThrow(/whole, non-negative/);
expect(() => impl.splitBill(1.5, 2)).toThrow(/whole, non-negative/);
expect(() => impl.splitBill(100, 0)).toThrow(/at least 1/);
expect(() => impl.splitBill(100, 1.5)).toThrow(/at least 1/);
});
it("paginate returns nothing for impossible pages", () => {
const items = [1, 2, 3];
for (const [page, size] of [[0, 2], [1, 0], [1.5, 2], [1, 2.5]]) expect(impl.paginate(items, page, size)).toEqual([]);
});
it("parseDate rejects month 13, month 0 and short years", () => {
for (const s of ["2026-13-01", "2026-00-10", "26-01-01", "2026-1-01", " 2026-01-01"]) expect(impl.parseDate(s)).toBeNull();
});
it("slugify handles empty, padded and full-width text", () => {
expect(impl.slugify("")).toBe("untitled");
expect(impl.slugify("--Hello--")).toBe("hello");
expect(impl.slugify("Hello World")).toBe("hello-world");
});
it("applyDiscount rejects impossible prices and percentages", () => {
for (const [p, pct] of [[-1, 10], [10, -1], [10, 101], [NaN, 10]]) expect(() => impl.applyDiscount(p, pct)).toThrow(/percent 0-100/);
expect(impl.applyDiscount(10, 100)).toBe(0);
expect(impl.applyDiscount(0.05, 50)).toBe(0.02); // the 2.5-cent discount rounds up to 3 cents
});
it("safeFileName limits length and replaces odd characters", () => {
expect(impl.safeFileName("a".repeat(300))).toHaveLength(120);
expect(impl.safeFileName("")).toBe("file");
expect(impl.safeFileName("my file?.pdf")).toBe("my_file_.pdf");
expect(impl.safeFileName("C:\\Users\\x\\.env")).toBe("env");
});
it("retry rejects zero or fractional attempts", async () => {
await expect(impl.retry(async () => 1, 0)).rejects.toThrow(/at least 1/);
await expect(impl.retry(async () => 1, 1.5)).rejects.toThrow(/at least 1/);
});
it("isEmail anchors both ends and limits length", () => {
for (const s of ["@a@b.co", "a@b.co@", "a b@c.co", "a@b", "a".repeat(250) + "@b.co"]) expect(impl.isEmail(s)).toBe(false);
});
});
Of the 19 changes still surviving, several cannot change behaviour at all: page < 1 can be removed because page 0 already gives an empty slice. Most of the rest are in the retry delays, which the tests skip by passing a delay of 0. That is a judgement call, not a failure: a mutation score is a map of what your tests do not check, and you decide which gaps matter. Note also what this does not measure. Coverage, the usual number, was high long before the score was: the lines ran, but nothing checked their results.
The reviewed code
// The same functions after review, each written so that the property tests below hold.
export function splitBill(totalCents: number, people: number): number[] {
if (!Number.isInteger(totalCents) || totalCents < 0) throw new RangeError("totalCents must be a whole, non-negative number");
if (!Number.isInteger(people) || people < 1) throw new RangeError("people must be a whole number of at least 1");
const base = Math.floor(totalCents / people);
const extra = totalCents % people; // the first "extra" people pay one cent more
return Array.from({ length: people }, (_, i) => base + (i < extra ? 1 : 0));
}
export function paginate<T>(items: T[], page: number, size: number): T[] {
if (!Number.isInteger(page) || page < 1 || !Number.isInteger(size) || size < 1) return [];
return items.slice((page - 1) * size, page * size);
}
export function parseDate(s: string): Date | null {
const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(s);
if (!m) return null;
const [y, mo, d] = [Number(m[1]), Number(m[2]), Number(m[3])];
const date = new Date(Date.UTC(y, mo - 1, d));
// Reject dates the calendar does not have instead of rolling them over
return date.getUTCFullYear() === y && date.getUTCMonth() === mo - 1 && date.getUTCDate() === d ? date : null;
}
export function slugify(title: string): string {
const slug = title
.normalize("NFKC")
.toLowerCase()
.replace(/[^\p{L}\p{N}]+/gu, "-") // keep letters and digits in every script
.replace(/^-+|-+$/g, "");
return slug || "untitled";
}
// Work in whole cents so floating point cannot leave 17.991; better still, store money as cents everywhere.
export function applyDiscount(price: number, percent: number): number {
if (!(price >= 0) || !(percent >= 0 && percent <= 100)) throw new RangeError("price must be >= 0 and percent 0-100");
const cents = Math.round(price * 100);
return (cents - Math.round((cents * percent) / 100)) / 100;
}
export function safeFileName(name: string): string {
const base = name.split(/[/\\]/).pop() ?? ""; // drop any directory part
const cleaned = base.replace(/[^\p{L}\p{N}._-]+/gu, "_").replace(/^\.+/, ""); // no leading dots: no "..", no hidden files
return cleaned.slice(0, 120) || "file";
}
export async function retry<T>(fn: () => Promise<T>, attempts: number, delayMs = 200): Promise<T> {
if (!Number.isInteger(attempts) || attempts < 1) throw new RangeError("attempts must be at least 1");
let lastError: unknown;
for (let i = 0; i < attempts; i++) {
try {
return await fn();
} catch (err) {
lastError = err;
if (i < attempts - 1) await new Promise((r) => setTimeout(r, delayMs * 2 ** i));
}
}
throw lastError;
}
export function isEmail(s: string): boolean {
// Deliberately loose: one @, something before it, a dot in the domain, no spaces. Confirm by sending a link.
return s.length <= 254 && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s);
}
The fixes are as interesting as the bugs. Bill shares use the remainder so they always add up. Dates are rebuilt and compared, so a day the calendar does not have is rejected. Slugs keep letters and digits in every script. Money is handled in whole cents. File names lose their directory part and any leading dots. Retry counts the attempts it is given, with backoff between them. And the email check is deliberately loose, because the only real test of an address is sending a message to it.
Security checks for generated code
The safeFileName bug is the dangerous one: a file called .. joined to an uploads folder points at its parent. Review every place generated code touches the file system, a shell, SQL or HTML with the same suspicion as user input, because it often is user input. Check new dependencies the assistant adds (do they exist, are they maintained, is the name a typo of a popular package?), look for secrets pasted into code, and run your usual security scanner in CI. The AI code review agent can flag some of this on every pull request, but it is one more reviewer, not a replacement for tests.
A review pipeline for AI-generated code
Put the cheap, automatic checks in CI so every pull request runs them, and save human attention for intent: does this code do what the ticket asks, and what happens with input nobody wrote down? Release generated changes behind a feature flag to a small share of users first, watch errors and business numbers, and keep rollback one click away. Every bug that still gets through becomes a new property or edge-case test.
When to trust AI-generated code, and when not to
| Lower risk: trust with normal review | Higher risk: test hard before trusting |
|---|---|
| UI layout, boilerplate, glue code | Money, dates, time zones, units |
| Code covered by strong existing tests | Code with no tests, or tests the AI wrote |
| Pure functions with clear rules | File paths, shell, SQL, HTML, auth |
| Throwaway scripts and prototypes | Retries, concurrency, caching, migrations |
| Code you could write yourself and can read fully | Code in a language or library you do not know |
Common mistakes and how to fix them
| Mistake | What happens | Fix |
|---|---|---|
| Accepting AI tests as proof | Tests share the code's wrong assumptions | Write edge cases and properties yourself |
| Counting a green type check as review | Logic bugs pass silently | Types and lint are a floor, not a review |
| Testing only English, ASCII input | Other scripts break in production | Generate Unicode in property tests |
| Money in floating point | Cents drift: 17.991 | Integer cents end to end |
| Trusting user file names | Path traversal with ".." | Strip directories and leading dots; allowlist characters |
| Measuring coverage only | Lines run, nothing checked | Mutation testing shows what the tests verify |
| Shipping to everyone at once | A rare-input bug hits all users | Feature flag and small rollout |
Limitations
The bugs here were seeded by hand to represent common kinds; they are not a sample of real assistant output, and real generated code will have a different mix, so read the counts as an illustration of what each strategy can catch, not as a rate. Property tests need someone to state good properties, which is a skill. Mutation testing is slow on large code bases, so run it on the files that matter or on changed files only. And none of this replaces understanding the code: if nobody on the team can explain a generated function, it should not be in production.
Running it yourself
npm install -D typescript vitest fast-check @stryker-mutator/core @stryker-mutator/vitest-runner typescript-eslint eslint
IMPL=assistant npx vitest run # the buggy code: 23 of 33 tests fail
IMPL=reviewed npx vitest run # the reviewed code: 33 of 33 pass
npx stryker run stryker.all.json # mutation score of the full suite
npx eslint src/assistant.ts && npx tsc --noEmit -p . # both pass on the buggy code
The full project is small: two implementations, three test files and a Stryker config per suite. Point it at your own generated functions, write one property per function, and see what survives.
Frequently asked questions
How do I test AI-generated code before production?
Write edge-case and property-based tests yourself, run mutation testing to check the tests, review security-sensitive code by hand, and release behind a feature flag to a small group first.
Are the tests an AI assistant writes good enough?
Not on their own. In this article's test they caught none of eight seeded bugs, because they shared the code's assumptions. Keep them, but add your own.
Does TypeScript strict mode catch AI code bugs?
It catches type errors, not logic errors. Strict tsc and ESLint strictTypeChecked caught none of the eight bugs here.
What is property-based testing?
A test that states a rule that must hold for every input, such as "shares add up to the total", and lets a library like fast-check generate many inputs to find one that breaks it.
What is mutation testing?
A tool such as Stryker makes small changes to your code and runs your tests; a change the tests do not notice is a gap in the tests. The share of changes caught is the mutation score.
What bugs are common in AI-generated code?
Off-by-one errors, rounding and floating-point money, impossible dates, text outside the Latin alphabet, unsafe file paths, overly strict regular expressions and retry logic, plus made-up or outdated APIs.
Should I let AI write my tests?
Use it to draft tests, then add the edge cases and properties yourself. Tests written from the same prompt as the code tend to repeat its mistakes.
How do I review AI-generated code for security?
Treat file paths, shell commands, SQL and HTML it builds as untrusted input, check every new dependency, look for secrets, and run a security scanner in CI.
Is code coverage enough for AI code?
No. Coverage shows which lines ran, not whether any test would fail if they were wrong. Mutation testing measures that.
When can I trust AI-generated code?
When it is covered by strong tests you trust, the logic is simple, and you can read and explain all of it. Be most careful with money, dates, paths, security and concurrency.
What does fast-check shrinking do?
When a property fails, fast-check keeps simplifying the failing input until it finds the smallest one that still fails, such as splitBill(1, 2).
How do I roll out AI-written changes safely?
Behind a feature flag, to a small share of users first, with error and business metrics watched and a quick rollback ready.