|
| 1 | +# Parity Status — claw-code Rust Port |
| 2 | + |
| 3 | +Last updated: 2026-04-03 |
| 4 | + |
| 5 | +## Mock parity harness — milestone 1 |
| 6 | + |
| 7 | +- [x] Deterministic Anthropic-compatible mock service (`rust/crates/mock-anthropic-service`) |
| 8 | +- [x] Reproducible clean-environment CLI harness (`rust/crates/rusty-claude-cli/tests/mock_parity_harness.rs`) |
| 9 | +- [x] Scripted scenarios: `streaming_text`, `read_file_roundtrip`, `grep_chunk_assembly`, `write_file_allowed`, `write_file_denied` |
| 10 | + |
| 11 | +## Mock parity harness — milestone 2 (behavioral expansion) |
| 12 | + |
| 13 | +- [x] Scripted multi-tool turn coverage: `multi_tool_turn_roundtrip` |
| 14 | +- [x] Scripted bash coverage: `bash_stdout_roundtrip` |
| 15 | +- [x] Scripted permission prompt coverage: `bash_permission_prompt_approved`, `bash_permission_prompt_denied` |
| 16 | +- [x] Scripted plugin-path coverage: `plugin_tool_roundtrip` |
| 17 | +- [x] Behavioral diff/checklist runner: `rust/scripts/run_mock_parity_diff.py` |
| 18 | + |
| 19 | +## Harness v2 behavioral checklist |
| 20 | + |
| 21 | +Canonical scenario map: `rust/mock_parity_scenarios.json` |
| 22 | + |
| 23 | +- Multi-tool assistant turns |
| 24 | +- Bash flow roundtrips |
| 25 | +- Permission enforcement across tool paths |
| 26 | +- Plugin tool execution path |
| 27 | +- File tools — harness-validated flows |
| 28 | + |
| 29 | +## Tool Surface: 40/40 (spec parity) |
| 30 | + |
| 31 | +### Real Implementations (behavioral parity — varying depth) |
| 32 | + |
| 33 | +| Tool | Rust Impl | Behavioral Notes | |
| 34 | +|------|-----------|-----------------| |
| 35 | +| **bash** | `runtime::bash` 283 LOC | subprocess exec, timeout, background, sandbox — **strong parity**. Missing: sedValidation, pathValidation, readOnlyValidation, destructiveCommandWarning, commandSemantics (upstream has 18 submodules for bash alone) | |
| 36 | +| **read_file** | `runtime::file_ops` | offset/limit read — **good parity** | |
| 37 | +| **write_file** | `runtime::file_ops` | file create/overwrite — **good parity** | |
| 38 | +| **edit_file** | `runtime::file_ops` | old/new string replacement — **good parity**. Missing: replace_all was recently added | |
| 39 | +| **glob_search** | `runtime::file_ops` | glob pattern matching — **good parity** | |
| 40 | +| **grep_search** | `runtime::file_ops` | ripgrep-style search — **good parity** | |
| 41 | +| **WebFetch** | `tools` | URL fetch + content extraction — **moderate parity** (need to verify content truncation, redirect handling vs upstream) | |
| 42 | +| **WebSearch** | `tools` | search query execution — **moderate parity** | |
| 43 | +| **TodoWrite** | `tools` | todo/note persistence — **moderate parity** | |
| 44 | +| **Skill** | `tools` | skill discovery/install — **moderate parity** | |
| 45 | +| **Agent** | `tools` | agent delegation — **moderate parity** | |
| 46 | +| **ToolSearch** | `tools` | tool discovery — **good parity** | |
| 47 | +| **NotebookEdit** | `tools` | jupyter notebook cell editing — **moderate parity** | |
| 48 | +| **Sleep** | `tools` | delay execution — **good parity** | |
| 49 | +| **SendUserMessage/Brief** | `tools` | user-facing message — **good parity** | |
| 50 | +| **Config** | `tools` | config inspection — **moderate parity** | |
| 51 | +| **EnterPlanMode** | `tools` | worktree plan mode toggle — **good parity** | |
| 52 | +| **ExitPlanMode** | `tools` | worktree plan mode restore — **good parity** | |
| 53 | +| **StructuredOutput** | `tools` | passthrough JSON — **good parity** | |
| 54 | +| **REPL** | `tools` | subprocess code execution — **moderate parity** | |
| 55 | +| **PowerShell** | `tools` | Windows PowerShell execution — **moderate parity** | |
| 56 | + |
| 57 | +### Stubs Only (surface parity, no behavior) |
| 58 | + |
| 59 | +| Tool | Status | Notes | |
| 60 | +|------|--------|-------| |
| 61 | +| **AskUserQuestion** | stub | needs user I/O integration | |
| 62 | +| **TaskCreate** | stub | needs sub-agent runtime | |
| 63 | +| **TaskGet** | stub | needs task registry | |
| 64 | +| **TaskList** | stub | needs task registry | |
| 65 | +| **TaskStop** | stub | needs process management | |
| 66 | +| **TaskUpdate** | stub | needs task message passing | |
| 67 | +| **TaskOutput** | stub | needs output capture | |
| 68 | +| **TeamCreate** | stub | needs parallel task orchestration | |
| 69 | +| **TeamDelete** | stub | needs team lifecycle | |
| 70 | +| **CronCreate** | stub | needs scheduler runtime | |
| 71 | +| **CronDelete** | stub | needs cron registry | |
| 72 | +| **CronList** | stub | needs cron registry | |
| 73 | +| **LSP** | stub | needs language server client | |
| 74 | +| **ListMcpResources** | stub | needs MCP client | |
| 75 | +| **ReadMcpResource** | stub | needs MCP client | |
| 76 | +| **McpAuth** | stub | needs OAuth flow | |
| 77 | +| **MCP** | stub | needs MCP tool proxy | |
| 78 | +| **RemoteTrigger** | stub | needs HTTP client | |
| 79 | +| **TestingPermission** | stub | test-only, low priority | |
| 80 | + |
| 81 | +## Slash Commands: 67/141 upstream entries |
| 82 | + |
| 83 | +- 27 original specs (pre-today) — all with real handlers |
| 84 | +- 40 new specs — parse + stub handler ("not yet implemented") |
| 85 | +- Remaining ~74 upstream entries are internal modules/dialogs/steps, not user `/commands` |
| 86 | + |
| 87 | +### Missing Behavioral Features (in existing real tools) |
| 88 | + |
| 89 | +**Bash tool — upstream has 18 submodules, Rust has 1:** |
| 90 | +- [x] `sedValidation` — validate sed commands before execution |
| 91 | +- [x] `pathValidation` — validate file paths in commands |
| 92 | +- [x] `readOnlyValidation` — block writes in read-only mode |
| 93 | +- [x] `destructiveCommandWarning` — warn on rm -rf, etc. |
| 94 | +- [x] `commandSemantics` — classify command intent |
| 95 | +- [x] `bashPermissions` — permission gating per command type |
| 96 | +- [x] `bashSecurity` — security checks |
| 97 | +- [x] `modeValidation` — validate against current permission mode |
| 98 | +- [x] `shouldUseSandbox` — sandbox decision logic |
| 99 | + |
| 100 | +Harness note: milestone 2 validates bash success plus workspace-write escalation approve/deny flows, but the deeper validation/security submodules above are still open. |
| 101 | + |
| 102 | +**File tools — need verification:** |
| 103 | +- [x] Path traversal prevention (symlink following, ../ escapes) |
| 104 | +- [x] Size limits on read/write |
| 105 | +- [x] Binary file detection |
| 106 | +- [ ] Permission mode enforcement (read-only vs workspace-write) |
| 107 | + |
| 108 | +Harness note: read_file, grep_search, write_file allow/deny, and multi-tool same-turn assembly are now covered by the mock parity harness. |
| 109 | + |
| 110 | +**Config/Plugin/MCP flows:** |
| 111 | +- [ ] Full MCP server lifecycle (connect, list tools, call tool, disconnect) |
| 112 | +- [ ] Plugin install/enable/disable/uninstall full flow |
| 113 | +- [ ] Config merge precedence (user > project > local) |
| 114 | + |
| 115 | +Harness note: external plugin discovery + execution is now covered via `plugin_tool_roundtrip`; full lifecycle and MCP behavior remain open. |
| 116 | + |
| 117 | +## Runtime Behavioral Gaps |
| 118 | + |
| 119 | +- [ ] Permission enforcement across all tools (read-only, workspace-write, danger-full-access) |
| 120 | +- [ ] Output truncation (large stdout/file content) |
| 121 | +- [ ] Session compaction behavior matching |
| 122 | +- [ ] Token counting / cost tracking accuracy |
| 123 | +- [x] Streaming response support validated by the mock parity harness |
| 124 | + |
| 125 | +Harness note: current coverage now includes write-file denial, bash escalation approve/deny, and plugin workspace-write execution paths. |
| 126 | + |
| 127 | +## Migration Readiness |
| 128 | + |
| 129 | +- [ ] `PARITY.md` maintained and honest |
| 130 | +- [ ] No `#[ignore]` tests hiding failures (only 1 allowed: `live_stream_smoke_test`) |
| 131 | +- [ ] CI green on every commit |
| 132 | +- [ ] Codebase shape clean for handoff |
0 commit comments