Verify and document that all exit paths are covered:
- Orphan cleanup on startup via cleanup_orphans()
- RAII CleanupGuard ensures cleanup on drop
- Global cleanup_temp_dir() before process::exit()
- Atexit handler registration for external signals
- Signal handling for SIGINT/SIGTERM
- HookInstaller cleanup with idempotent flag
- Panic safety with catch_unwind
All 90 library tests + 28 integration tests pass.
Exit path matrix shows all scenarios covered with defense in depth.
Co-Authored-By: Claude <noreply@anthropic.com>
Verified that temp dir and FIFO cleanup happens on all exit paths:
- Normal exit: CleanupGuard Drop
- Error exit: CleanupGuard Drop
- Watchdog timeout: CleanupGuard Drop after event loop exits
- Signal interruption: CleanupGuard Drop after event loop exits
- Panic: catch_unwind + CleanupGuard Drop
- process::exit(): explicit cleanup_temp_dir() call
- External signals: atexit handler
Orphan cleanup on startup implemented in cleanup_orphans():
- Sweeps claude-print-* dirs older than 10 minutes
- Removes FIFO first, then entire directory
- Called early in main() before any session runs
All cleanup-related tests pass (90 tests total).
Implementation is idempotent with retry logic for transient errors.
Co-Authored-By: Claude <noreply@anthropic.com>
Verified that all cleanup mechanisms are properly implemented:
- Orphan cleanup on startup (10-minute threshold)
- CleanupGuard for automatic RAII cleanup
- Global cleanup before process::exit()
- Idempotent cleanup with retry logic
All exit paths covered:
- Normal exit (success/error)
- Timeout exit
- Signal interruption (SIGINT/SIGTERM)
- Watchdog timeout
- Panic
- Early returns
All tests passing. No orphaned temp directories found.
Bead-Id: bf-2w7
- Verify comprehensive cleanup on all exit paths
- Document all cleanup mechanisms and their locations
- Confirm all 90 tests pass including cleanup-specific tests
- Exit path matrix shows all paths covered
Co-Authored-By: Claude <noreply@anthropic.com>
Bead-Id: bf-2w7
- Add cleanup_performed flag to HookInstaller for idempotent cleanup
- Add Drop implementation to HookInstaller for automatic cleanup
- Enhance cleanup() to explicitly remove both FIFO and temp directory
- Ensure temp dirs are cleaned up on normal exit, error, timeout, signals, and panic
- cleanup_orphans() already called at startup to sweep stale temp dirs
Co-Authored-By: Claude <noreply@anthropic.com>
- Confirm all cleanup mechanisms are in place and working
- All 90 tests pass
- Orphan sweeping on startup, Drop guard for normal paths, global cleanup for process::exit()
- All exit paths covered: normal, error, watchdog timeout, signal interruption
Co-Authored-By: Claude <noreply@anthropic.com>
Root cause: Child claude hangs at startup when global settings containing
hooks (SessionStart, SessionEnd, etc.) are inherited despite creating a
temp settings.json with only a Stop hook.
When --settings=<temp_path> is passed without --setting-sources=, Claude Code
merges temp settings with global settings. Global hooks fire and may hang,
causing the child to never produce output and the first-output timeout to fire.
Fix: Always pass --setting-sources= to child claude (src/session.rs:127-129)
to prevent global settings inheritance. This ensures ONLY the temp settings.json
is loaded, preventing any global hooks from causing hangs.
Evidence: Documented in notes/bf-2u1-findings.md and notes/bf-2u1-investigation.md
Related beads:
- bf-2w7: temp dir and FIFO cleanup
- bf-3ag: session implementation
- Add cleanup_orphans() to HookInstaller: sweeps stale claude-print-* dirs on startup
- Add cleanup() method to HookInstaller: explicitly removes FIFO and temp dir artifacts
- Add CleanupGuard struct in session.rs: ensures cleanup via Drop on all exit paths
- Call cleanup_orphans() in HookInstaller::new() on each invocation
This prevents orphaned temp directories from accumulating after crashes,
timeouts, or signal interruptions.
Co-Authored-By: Claude <noreply@anthropic.com>
Bead-Id: bf-2w7
All 13 emitter tests pass. Implementation completed in commit bfb50da.
Verified output formatting for text, json, and stream-json formats.
Co-Authored-By: Claude <noreply@anthropic.com>
bf-4r6 (Write AGENTS.md) was blocked on bf-40i (Wire main()), but
documentation writing does not require main() to be functional.
Removing this dependency makes bf-4r6 ready for a worker to claim.
bf-52c's dependency on bf-40i remains correct — binary E2E tests
genuinely require a working binary.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Verified claude-print-ci WorkflowTemplate is present in iad-ci and
shows Synced status in ArgoCD app argo-workflows-ns-iad-ci. Overall
app is OutOfSync/Degraded due to pre-existing unrelated pdftract and
ExternalSecret issues.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
WorkflowTemplate/claude-print-ci shows Sync: Synced in ArgoCD app
argo-workflows-ns-iad-ci, and is present in iad-ci cluster (created
2026-06-10T06:09:14Z). Overall app is OutOfSync due to pre-existing
unrelated pdftract/ExternalSecret issues outside this bead's scope.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copied claude-print.yaml to ~/.config/needle/adapters/ and confirmed
needle test-agent returns Status: READY with stdin input and
needle-transform-claude transform.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
install.sh was created in Phase 9 (commit 50b2132). Verified it passes
bash -n, covers x86_64/aarch64 musl targets, installs with -m 755 to
~/.local/bin, and runs claude-print --check post-install.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>
All 13 emitter unit tests pass on re-verification. Implementation was
already complete from prior run; this run confirms correctness and
commits the bead close state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All tests pass including test_stop_hook_fires and
test_missing_transcript_path_derived. Implementation complete in 59e170e.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Verifies test_stop_hook_fires and test_missing_transcript_path_derived pass;
documents the FIFO open race resolution (OQ-4) and path derivation algorithm.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All open beads are transitively blocked waiting on bf-64s (Phase 6, in_progress).
No configuration error — sequential dependency chain is working as designed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implementation was already present from bf-54m. make_prompt_payload()
wraps the startup prompt in ESC[200~ / ESC[201~\r; injection fires after
the post-dismiss idle gap. All 41 tests pass confirming correct behavior.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All 9 terminal unit tests pass. TerminalEmu in terminal.rs handles
DA1/DA2/DSR/XTVERSION/WinSize probes with dedup bitmask and split-chunk
accumulation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
All three deliverables (--no-inherit-hooks flag, mock-claude fixture,
test_pty_spawns_tty integration test) were implemented in 17c35f4.
This commit records the bead closure and verified acceptance.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>