Bash glob expansion in loops
You're auditing a deploy script and ask an AI to explain this Bash loop. The agent says: "It iterates over every file in the backups directory and deletes ones older than 30 days — safe and standard." You're about to run it on a production server. What does the explanation miss, and how do you verify the actual behavior without risking data?
Implement
unsafe_loop_targets(filenames: list[str]) → list[str]Examples
in
[["jan 2026.tar","app.log"]]out["jan","2026.tar","app.log"]in
[["backup.tar","db.sql"]]out["backup.tar","db.sql"]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 14 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.