644cccd3e1
* fix(worker): add JSON status output for hook framework (#638) Adds JSON output before all process.exit() calls in the start command so Claude Code's hook framework can track worker startup progress. - Add exitWithStatus() helper function - Output {"continue":true,"suppressOutput":true,"status":"ready"|"error"} - Maintains exit code 0 for Windows Terminal compatibility Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * test(worker): add unit tests for buildStatusOutput function Extract buildStatusOutput() as pure function for testability and add comprehensive unit tests validating JSON structure for hook framework. Tests cover: - Ready/error status variants - Required fields (continue, suppressOutput, status) - Optional message field inclusion logic - Edge cases (empty strings, special characters, long messages) - JSON serialization roundtrip Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * test(worker): add CLI output capture tests for start command Add integration tests that spawn actual worker-service start command and verify JSON output matches hook framework contract. Tests: - Valid JSON with required fields (continue, suppressOutput, status) - JSON structure matches expected format when worker healthy - Skipped placeholders for error scenarios requiring complex setup Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * test(worker): add Claude Code hook framework compatibility tests Add contract tests documenting the hook framework requirements: - Exit code 0 (Windows Terminal compatibility) - JSON output on stdout (not stderr) - Valid JSON structure with required fields - Critical 'continue: true' for Claude Code to proceed - 'suppressOutput: true' for transcript mode These tests serve as living documentation of the hook output contract, explaining both WHAT and WHY for each requirement. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>