Postgres job runner
Greenfield: direct an AI agent to build a background job runner in Python that pulls jobs from Postgres (no Redis/Celery allowed — single-binary deploy constraint), runs them with retries and backoff, and supports concurrent workers. Lay out the build plan: how you'd have it claim jobs safely, the retry/dead-letter model, and the acceptance criteria. What does a naive 'build a job queue on Postgres' prompt get wrong about concurrency?
claim_due_jobs(job_lines: list[str], now_epoch: int, visibility_timeout: int, worker_capacity: int) → list[str][["job_a|pending|900|0","job_b|pending|1100|0","job_c|running|0|990"],1000,60,5]out["job_a"][["job_c|running|0|900","job_a|pending|500|0","job_b|pending|500|0","job_d|done|0|0"],1000,60,2]out["job_c","job_a"]Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.