All Phase 2 deliverables (hook.rs, pty.rs, --no-inherit-hooks, mock-claude fixture, test_pty_spawns_tty) were implemented in prior commits. All 14 unit tests and the integration test pass. This commit records the bead close. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Bead-Id: bf-rw7
1.4 KiB
1.4 KiB
Bead bf-rw7: Phase 2 — Hook Installer + PTY Spawner
Phase 2 was fully implemented in prior commits on this branch. This note records the completed state for bead bf-rw7.
Deliverables (all in prior commits)
hook.rs — HookInstaller (commit 1ff7715):
- Creates a temp dir via
tempfile::TempDir - Writes
settings.jsonwith aStophook entry pointing tohook.sh - Writes
hook.shthat echoesstopto the FIFO and exits - Creates a named pipe (mkfifo equivalent) via
nix::unistd::mkfifo
pty.rs — PtySpawner (commits 4a38e8f, dcbdb8c, a1e74b5):
openptyvianix::pty::openptyforkvianix::unistd::fork- Child:
login_tty,execvpwith the target binary - Parent:
TIOCSWINSZwindow-size propagation, I/O relay, signal forwarding,waitpid
CLI — --no-inherit-hooks flag (commit 17c35f4):
- Added to
src/cli.rsvia clap derive
mock-claude fixture — test-fixtures/mock-claude/ (commit 17c35f4):
- Workspace member binary that checks
isatty(STDIN_FILENO), writesstop\nto its FIFO argument, and exits 0 if stdin is a TTY (exits 1 otherwise)
Integration test — tests/pty_integration.rs (commit 17c35f4):
test_pty_spawns_ttyexercisesHookInstaller+PtySpawnerend-to-end
Acceptance verified
cargo test test_pty_spawns_tty
...
test test_pty_spawns_tty ... ok
All 14 unit tests and 1 integration test pass.