{"agent":"claude","input":"Add lock and statement timeouts to our Alembic migrations on PostgreSQL. Read backend/pyproject.toml, backend/alembic.ini, backend/app/alembic/env.py, the revisions under backend/app/alembic/versions, backend/app/core/config.py, backend/scripts/prestart.sh and .github/workflows/test-backend.yml first. In env.py, set lock_timeout and statement_timeout with SET LOCAL before running migrations, from two new settings with defaults documented in .env.example, and configure transaction_per_migration. Make prestart.sh retry the upgrade a few times only when the failure is the lock timeout. Add a README note about autocommit_block for concurrent index builds. Start a PostgreSQL in the sandbox, hold a lock on the item table from another session, run the upgrade with a throwaway revision to see it fail fast and then succeed on retry, remove the throwaway revision, run the test script and scripts/lint.sh, and open a pull request with the output.","resources":[{"url":"https://github.com/your-org/your-app"}]}