{"agent":"claude","input":"Make the multi-step writes in this GORM application atomic. Read go.mod, the database setup, every model function and every handler and validator that calls one first. Run the tests and record the result. List each request path that issues more than one write, including writes that happen during request binding or validation, and for each say what is left behind today when a later step fails. Write a failing test for each path first: inject the failure with a GORM callback registered in the test only, and assert both the error response and that no earlier write persisted. Then wrap each path in db.Transaction and pass the transaction handle explicitly to every helper it calls; no function called inside a transaction may use the package-level database handle. Move any write out of validators. Keep retry loops outside the transaction closure so each attempt is a new transaction. Do not change response bodies or status codes, do not wrap single-statement handlers, and leave read-only transactions as they are but list them. Run the whole suite and the format check. Open a pull request that lists each path with its statements before and after, the functions whose signature changed, and the test output from before and after.","resources":[{"url":"https://github.com/your-org/your-app"}]}