claude-print/notes/bf-360.md
jedarden 6b5d114a03 Add bf-360 verification notes for --check subcommand
Confirms the --check subcommand (src/check.rs) is fully implemented:
openpty probe, mkfifo probe, optional mock_claude PTY round-trip,
exits 0 on success with diagnostic table, exits 2 on any FAIL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 01:44:16 -04:00

1.3 KiB

bf-360: --check subcommand verification

Task

Implement --check subcommand in claude-print.

Status

Already implemented in commit 50b2132 (Phase 9: NEEDLE integration).

Verification

Ran ./target/debug/claude-print --check on this system:

CHECK                RESULT DETAIL
------------------------------------------------------------------------
openpty              PASS   openpty() syscall succeeded
mkfifo               PASS   mkfifo succeeded (dir: /home/coding/.tmp)
mock_claude PTY      PASS   PTY round-trip OK — isatty=true in child (/home/coding/.local/bin/mock_claude)

All checks passed.
Exit code: 0

Implementation

  • src/check.rsrun() function with three probes:
    • probe_openpty(): calls openpty(None, None), drops handles, returns PASS/FAIL
    • probe_mkfifo(): creates a named FIFO in $TMPDIR, cleans up, returns PASS/FAIL
    • probe_mock_claude_pty(): optional; forks, execs mock_claude in a PTY slave via login_tty, waits up to 5s for exit 0
  • src/cli.rs--check flag wired into Cli struct
  • src/main.rsif cli.check { let code = claude_print::check::run(); process::exit(code); }
  • src/lib.rspub mod check; exported

All acceptance criteria met: cargo build succeeds, --check exits 0 with diagnostic table, missing openpty would exit 2 with FAIL row.