mirror of
https://github.com/instructkr/claude-code.git
synced 2026-05-16 19:06:44 +00:00
1.4 KiB
1.4 KiB
Mock LLM parity harness
This milestone adds a deterministic Anthropic-compatible mock service plus a reproducible CLI harness for the Rust claw binary.
Artifacts
crates/mock-anthropic-service/— mock/v1/messagesservicecrates/rusty-claude-cli/tests/mock_parity_harness.rs— end-to-end clean-environment harnessscripts/run_mock_parity_harness.sh— convenience wrapper
Scenarios
The harness runs these scripted scenarios against a fresh workspace and isolated environment variables:
streaming_textread_file_roundtripgrep_chunk_assemblywrite_file_allowedwrite_file_deniedmulti_tool_turn_roundtripbash_stdout_roundtripbash_permission_prompt_approvedbash_permission_prompt_deniedplugin_tool_roundtripauto_compact_triggeredtoken_cost_reporting
Run
cd rust/
./scripts/run_mock_parity_harness.sh
Behavioral checklist / parity diff:
cd rust/
python3 scripts/run_mock_parity_diff.py
Scenario-to-PARITY mappings live in mock_parity_scenarios.json; keep this manifest aligned with rust/crates/rusty-claude-cli/tests/mock_parity_harness.rs and PARITY.md via python3 scripts/run_mock_parity_diff.py --no-run.
Manual mock server
cd rust/
cargo run -p mock-anthropic-service -- --bind 127.0.0.1:0
The server prints MOCK_ANTHROPIC_BASE_URL=...; point ANTHROPIC_BASE_URL at that URL and use any non-empty ANTHROPIC_API_KEY.