story-kit: accept 124_story_test_coverage_llm_providers_claude_code_rs

This commit is contained in:
Dave
2026-02-24 00:19:57 +00:00
parent 0c9588d32c
commit bb7713d5bd

View File

@@ -0,0 +1,28 @@
---
name: "Add test coverage for llm/providers/claude_code.rs (54% -> 75%+)"
---
# Story 124: Add test coverage for llm/providers/claude_code.rs
Currently at 54% line coverage (496 lines, 259 missed). The Claude Code provider spawns `claude` CLI processes and manages their I/O.
## What to test
- Command argument construction (model, max-turns, budget, system prompt, append flags)
- Output parsing (streaming JSON events from claude CLI)
- Session ID extraction
- Process lifecycle management
- Error handling (process crash, invalid output, timeout)
- Permission request/response flow
## Notes
- Mock the process spawning rather than running real `claude` commands
- Test the output parsing logic with sample JSON event streams
- The argument construction logic is especially testable as pure functions
## Acceptance Criteria
- [ ] Line coverage for `llm/providers/claude_code.rs` reaches 75%+
- [ ] Tests pass with `cargo test`
- [ ] `cargo clippy` clean