Postgres backup script spec
You're directing an AI agent to write a Bash script that backs up a Postgres database nightly, uploads the dump to object storage, prunes backups older than 30 days, and alerts on failure. Write the spec that makes it production-safe on the first pass. What does a quick 'write a backup script' prompt get dangerously wrong?
Implement
plan_backup_run(dump_exit_code: int, dump_bytes: int, uploaded_bytes: int, listing_keys: list[str], listing_ages_days: list[int], prefix: str, retention_days: int) → list[str]Examples
in
[0,4096,4096,["pg/2026-06-01.dump.gz","pg/2026-07-30.dump.gz","logs/app.log"],[62,2,400],"pg/",30]out["upload:verified","delete:pg/2026-06-01.dump.gz"]in
[2,0,-1,["pg/2026-05-01.dump.gz"],[90],"pg/",30]out["alert:dump_failed","prune:skipped"]in
[0,8000,12,["pg/2026-05-01.dump.gz"],[90],"pg/",30]out["alert:size_mismatch","prune:skipped"]What a strong answer looks like
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.
0:00 of about 16 min
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.