01 / State criteria
State the acceptance criteria clearly. List the required behavior and constraints, using the same criteria for both candidate patches.
02 / Request evidence
Request evidence, not confidence. Ask for specific defects tied to a requirement or test, and check the explanation yourself.
03 / Run project checks
Run the project's checks. Inspect the diff and run relevant tests. Keep the original, choose a patch, make another fix, or reject both.
A concrete review prompt
Requirement: parseRetryAfter(value) accepts a string containing only non-negative, safe integer seconds, with optional surrounding whitespace. Return null for null, empty input, decimals, unsafe integers, or any other characters. Keep the existing signature; add no dependencies.
Current patch:
export function parseRetryAfter(value) {
const seconds = Number.parseInt(value, 10);
return Number.isSafeInteger(seconds) && seconds >= 0 ? seconds : null;
}
Rival patch:
export function parseRetryAfter(value) {
if (typeof value !== "string" || !/^\d+$/.test(value.trim())) return null;
const seconds = Number(value.trim());
return Number.isSafeInteger(seconds) ? seconds : null;
}
Tests:
expect(parseRetryAfter(" 12 ")).toBe(12);
expect(parseRetryAfter("12s")).toBeNull();
expect(parseRetryAfter("1.5")).toBeNull();
expect(parseRetryAfter("")).toBeNull();
Compare both patches against the requirement and tests. Identify specific failures. Keep either patch, reject both, or suggest a separate minimal fix. Do not force a merge.Check the result: A model can agree with you without being right. Inspect the diff and run the tests yourself. Stop when the checks are done.