{"agent":"claude","input":"Add slow query logging to this Flask + SQLAlchemy app. Read requirements.txt, config.py, app/__init__.py, app/models.py, app/main/routes.py, app/tasks.py, boot.sh and tests.py first. Do not use Flask-SQLAlchemy's SQLALCHEMY_RECORD_QUERIES, because app/tasks.py runs queries in an rq worker outside any request; use SQLAlchemy's before_cursor_execute and after_cursor_execute engine events instead. Write app/slow_queries.py with an init_app that registers both listeners on db.engine, storing the start time in conn.info and logging one warning through the app logger when the elapsed time crosses SLOW_DB_QUERY_SECONDS, with the duration in milliseconds, the statement and the number of parameters, never their values; pass stacklevel so the log's pathname and lineno point at the caller. Add SLOW_DB_QUERY_SECONDS to config.py from the environment with a default of 0.5 and set it to 0 in TestConfig. Call init_app from create_app after db.init_app so the worker is covered too. Add a SlowQueryCase to tests.py using assertLogs for a record at threshold 0 and no record above it. Run python -m unittest tests.py -v, start the app with LOG_TO_STDOUT=1 and the threshold at 0, load /explore, install Redis, run an rq worker, trigger /export_posts, and paste the warnings from both processes and the test output into the pull request. Change no query or template.","resources":[{"url":"https://github.com/your-org/your-app"}]}