Files
claw-code/rust/MOCK_PARITY_HARNESS.md
Yeachan-Heo 85c5b0e01d Expand parity harness coverage before behavioral drift lands
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
2026-04-03 04:00:33 +00:00

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/messages service
  • crates/rusty-claude-cli/tests/mock_parity_harness.rs — end-to-end clean-environment harness
  • scripts/run_mock_parity_harness.sh — convenience wrapper

Scenarios

The harness runs these scripted scenarios against a fresh workspace and isolated environment variables:

  1. streaming_text
  2. read_file_roundtrip
  3. grep_chunk_assembly
  4. write_file_allowed
  5. write_file_denied
  6. multi_tool_turn_roundtrip
  7. bash_stdout_roundtrip
  8. bash_permission_prompt_approved
  9. bash_permission_prompt_denied
  10. plugin_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.