mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-05 23:54:50 +08:00
The landed mock Anthropic harness now covers multi-tool turns, bash flows, permission prompt approve/deny paths, and an external plugin tool path. A machine-readable scenario manifest plus a diff/checklist runner keep the new scenarios tied back to PARITY.md so future additions stay honest. Constraint: Must build on the deterministic mock service and clean-environment CLI harness Rejected: Add an MCP tool scenario now | current MCP tool surface is still stubbed, so plugin coverage is the real executable path Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep rust/mock_parity_scenarios.json, mock_parity_harness.rs, and PARITY.md refs in lockstep Tested: cargo fmt --all Tested: cargo clippy --workspace --all-targets -- -D warnings Tested: cargo test --workspace Tested: python3 rust/scripts/run_mock_parity_diff.py Not-tested: Real MCP lifecycle handshakes; remote plugin marketplace install flows
1.2 KiB
1.2 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_roundtrip
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.
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.