| 1 | # Brief: Paul's typed answers never reach terminalAnswer |
| 2 | |
| 3 | Branch `tty-answers` from main a2774dc. OFFLINE ONLY: Paul's run |
| 4 | (run-4024280761) is live right now on his accounts; do not launch |
| 5 | providers, do not touch ~/.local/share/equipo*, read-only evidence ok. |
| 6 | |
| 7 | Symptom across every real run: Paul types `Allow once` + Return at the |
| 8 | guide's prompt (printed by internal/directlive/terminal.go via /dev/tty), |
| 9 | the line echoes in his terminal, and nothing is ever read: no person |
| 10 | answer artifact, the control step times out (run-4024280761 |
| 11 | claude-Engineering: `controls: context deadline exceeded`, only an |
| 12 | `answered_by: automatic` answer-8 file exists; run-582068017 Codex |
| 13 | controls timed out after his Allow once; run 3's "recorded" message was |
| 14 | printed before reading, so no person answer has EVER been read). |
| 15 | Astra's previous pty tests fed terminalAnswer directly, not the real |
| 16 | process chain. |
| 17 | |
| 18 | Real chain: Paul's interactive bash on docs-t1 (ssh or local terminal) |
| 19 | → scripts/try-equipo.sh (sh) → `go run ./cmd/equipo-try` → wizard reads |
| 20 | earlier prompts from stdin via bufio (internal/tryequipo/state.go) → |
| 21 | spawns `go test -timeout=0 -tags direct_live ./internal/runner/provider |
| 22 | -run ^TestDirectLive...` (internal/tryequipo/command.go childCommand, |
| 23 | process group / Setpgid / Ctty settings) → test binary → directlive |
| 24 | driver → provider launches in bwrap (--new-session?) → terminalAnswer |
| 25 | opens /dev/tty O_NONBLOCK, TCIFLUSH, prints, polls, reads. |
| 26 | |
| 27 | Find the root cause by reproducing the WHOLE chain under a real pty (e.g. |
| 28 | python pty.fork or `script -qfc`) with a fake answer request (no |
| 29 | provider: stub the driver or use an existing fake-CLI harness), typing as |
| 30 | a human would AFTER the prompt appears. Candidates to test, not assume: |
| 31 | another process in the chain reading the tty (wizard bufio on stdin, |
| 32 | `go test` stdin handling, a provider or bwrap child inheriting the tty), |
| 33 | the reader's process not in the foreground process group (SIGTTIN/EIO), |
| 34 | TCIFLUSH discarding the line (timing), O_NONBLOCK + poll on a different |
| 35 | open file description, canonical-mode differences, `go test` buffering. |
| 36 | Fix it so the real chain delivers the line, add a regression test that |
| 37 | runs the real chain (wizard → go test → reader) under a pty, and make |
| 38 | the guide print a short confirmation only AFTER an answer is actually |
| 39 | read and accepted. Targeted tests, ONE full `make -k ci` (rerun at most |
| 40 | twice). Commit subject < 80, body `Co-Authored-By: Astra |
| 41 | <noreply@openai.com>`, push. CONTROLLER-REPORT-tty-answers.md. Scratch |
| 42 | removed; nothing running; no copy-review server. Print a five-line |
| 43 | summary. |
| 44 | |