---
name: conpty-injected-echo-loss
description: Windows ConPTY does not surface the cooked echo of programmatically-injected PTY input; byte-receipt of injected payloads must be asserted on forkpty (unix), captured on Windows.
metadata:
  type: project
---

When asserting that an INJECTED PTY payload (broker `write_input` from the inject
worker / send-effect, not interactively typed) actually reached the PTY child, the
echo-based observation seam that works for OPERATOR keystrokes does NOT work on
Windows ConPTY.

Observed during W2 Layer G (REQ-MSG-IDLE-TRANSLATION-BINARY) int gate authoring,
2026-06-19, in `crates/spt-daemon/tests/inject_control_wedge.rs`:
- An OPERATOR keystroke sent via `Brain::send_input` echoes back through the broker
  output ring (the cross-OS `findstr "."` / `cat` echo child) — g3 `secret_on_pty`
  proves this on Windows.
- The SAME bytes written by the inject worker's `write_input` (the ADR-0022
  choreography `{text:XLATE_OK}`) do NOT re-emit through ConPTY's cooked echo, even
  with XON (`ctrl+q`/0x11) sent to resume flow after the choreography's `ctrl+s`
  (XOFF/0x13). The injected line's echo is lost on ConPTY.
- A CUSTOM Rust PTY child reading `io::stdin().read()` does NOT receive ConPTY input
  writes at all (only console-native apps like findstr/cmd/cat do) — so a
  side-file byte-recorder child is also unusable on Windows for byte-receipt.

**Why:** ConPTY surfaces interactively-typed input as console input records the
child reads via the console API; programmatic master writes that the broker injects
do not get cooked-echoed the same way, and `io::stdin()` byte reads miss them.

**How to apply:** Assert injected-payload byte-receipt with `#[cfg(unix)]` (forkpty
cooked-mode echoes the injected line reliably; gravity-linux CI is the venue), and
on `#[cfg(windows)]` CAPTURE+print the observation (never a false-red) while
hard-asserting the platform-independent facts (delivery accepted, session
serviceable via KIND_SESSIONS, a fresh attach serviced + receives output). This is
the SAME banked platform-divergence stance the file's W1 park-(b) and W1b gates
already use for ConPTY-vs-forkpty PTY behavior. See [[spt-test-conventions]] and
[[effect-journal-wedge-tests]].

Runner: this file HANGS under bare `cargo test --test inject_control_wedge`; run via
`cargo nextest run -p spt-daemon --test inject_control_wedge` (process-per-test) or
`-- --test-threads=1`. Also: a `BrainConn::Whole` (plain `cold_start`) IGNORES the
`read_event_until` deadline (blocking `read_frame`) — any test loop that may not
receive output MUST use `cold_start_pump` (Split) or it blocks forever.
