{"agent":"claude","input":"Add optimistic locking to Item updates. Read backend/pyproject.toml, backend/app/models.py, backend/app/crud.py, backend/app/api/routes/items.py, backend/app/core/db.py, backend/app/alembic/env.py, the revisions under backend/app/alembic/versions, backend/tests/conftest.py, backend/tests/api/routes/test_items.py, backend/scripts and frontend/src/components/Items/EditItem.tsx first. Add a version column to Item with a default of 1, return it on ItemPublic, require it on ItemUpdate, and make PUT /items/{id} a single conditional update that increments the version and answers 409 when the row's version does not match, keeping the 404 and 403 checks ahead of it. Write an Alembic migration with a server default. Pass the version from EditItem and regenerate the client with scripts/generate-client.sh. Add tests for the winning update, the stale update and the missing version. Start a PostgreSQL in the sandbox, run the migration and the test script, then scripts/lint.sh, and open a pull request with the output.","resources":[{"url":"https://github.com/your-org/your-app"}]}