test(mcp): prove tracedecay_source_edit_rollback behavior - #1673
ScriptedAlchemy wants to merge 1 commit into
Conversation
Call the production MCP rollback tool and assert restored move preimages, replay receipts, and typed refusals for stale bytes, missing confirmation, reused keys, and non-move effects. Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
|
|
Closing as superseded. A sibling change proving the same tool landed first as #1686. Evidence from the triage: git log origin/master --diff-filter=A -- mcp_handler_test/source_edit_rollback_test.rs => 5e300a6 on branch cursor/prove-source-edit-rollback-7cfc; gh pr list --state merged head:cursor/prove-source-edit-rollback-7cfc => 1686 'test(mcp): prove tracedecay_source_edit_rollback behavior'; same path added in both, 3 conflict hunks Reopen if the landed version misses an assertion this branch carries; name it and it can be ported as a small follow-up. |
Summary
tracedecay_source_edit_rollbackthrough the production MCP source-edit server, not the catalog schema.move_symbolrestores the exact preimage bytes, deletes the file the move created, and replays the same effect id.confirm=false, a reused idempotency key, a non-move effect, and a mismatched input digest are refused and leave the files untouched.Motivation
The existing catalog test only restates the rollback input schema. Callers need a behavior test that fails when the tool stops restoring retained preimages or starts accepting a stale workspace.
Changes
crates/tracedecay/tests/mcp_suite/mcp_handler_test/source_edit_rollback_test.rsexercises the daemon-owned MCP dispatch and asserts literal file bytes and tool payloads.test-transportMCP suite.Test plan
REQUIRE_EXACT_TEST_COUNT=3 scripts/require-exact-test.sh cargo test -p tracedecay --features test-transport --test mcp_suite source_edit_rollback_testcargo nextest run --workspace --no-fail-fastpassescargo clippyhas no new warningsChecklist
CHANGELOG.mdupdated (under[Unreleased]if no version bump).envfiles included