← ClaudeAtlas

interactive-script-phantom-answerslisted

A prompting script run without a TTY records fabricated answers instead of failing. Use when: (1) an interactive bash/python script "completed" but wrote empty or default values, (2) a wizard's summary says "wrote N values" yet the output file is blank, (3) `read -r` / `input()` returns instantly with no visible typing, (4) a y/N `confirm` resolved to its default that nobody chose, (5) you are about to tell a user to run an interactive script through an AI harness, a pipe, CI, or an editor "run" button. Covers the guard pattern for any script whose output becomes evidence.
MrBinnacle/skills · ★ 0 · AI & Automation · score 68
Install: claude install-skill MrBinnacle/skills
# Interactive Scripts Record Phantom Answers Without a TTY ## Problem `read` returns EOF immediately when stdin is not a terminal. It does not error. A prompting script therefore runs to completion, prints a cheerful summary, and writes a full set of values that **nobody supplied**. Empty strings are the mild case — they are at least visibly empty. The dangerous case is a **defaulted choice**. `confirm() { read -r reply; [[ "$reply" =~ ^[Yy] ]]; }` resolves to *no* on EOF. In the output file that `no` is byte-identical to a `no` a human typed. Measured instance, 2026-08-17: an 8-stage provisioning wizard was run through an AI harness. All ten values were written empty and one confirm produced `REVOCATION_SUPPORTED=no`. That flag was the answer to the single most consequential question in the setup, and a documented plan said a `no` there would narrow a merged architecture decision. **A fabricated answer was one step from changing an ADR.** It was caught by inspecting the output file, not by any guard — there was none. ## Context / Trigger Conditions - A wizard or setup script "succeeded" but its `.env` / config / report is empty or default. - The transcript shows two prompts printed on the same line with no input between them — the signature of back-to-back EOF reads. - A summary line like `wrote 10 value(s)` alongside a file whose values are all blank. - You are about to suggest running an interactive script via an AI tool, `cmd | script`, `script < /dev/null`, CI,