Give the coding Agent a reproducible function, expected behavior, failing input, and test command. Ask it to inspect code and tests before editing. Example: normalize(row) trims name and lowercases email. Missing or null email must stay null; present email is normalized. Test missing, null, blank, and valid values.
Decision
Give the coding Agent a reproducible function, expected behavior, failing input, and test command. Ask it to inspect code and tests before editing.
Worked example
Example: normalize(row) trims name and lowercases email. Missing or null email must stay null; present email is normalized. Test missing, null, blank, and valid values.
Failure checks
Run focused tests and repository validation yourself. Review unrelated diff changes. Until commands run, mark tests planned; a patch suggestion is not verification.
Offline example and Agent acceptance workflow
Compare the example input with the result and acceptance checks.
Input text
Local deterministic example: review this existing function against four input classes. It already meets the stated behavior; no code change is needed.
def normalize(row):
email = row.get("email")
return {"name": row["name"].strip(),
"email": email.strip().lower() if isinstance(email, str) else None}
cases = [
({"name": " A "}, None),
({"name": " A ", "email": None}, None),
({"name": " A ", "email": " "}, ""),
({"name": " A ", "email": " A@EXAMPLE.TEST "}, "a@example.test"),
]
assert [normalize(row)["email"] for row, _ in cases] == [expected for _, expected in cases]
Prompt for an Agent interface you already use
Review the supplied normalize function; do not change files. Return JSON fields decision, behavior, test_cases, verification_status. Check missing email, null, whitespace-only, and mixed-case email; state “no change needed” if the implementation already matches. Mark any unrun tests as planned, not run.