Skip to content

test(mcp): prove tracedecay_source_edit_rollback behavior - #1673

Closed
ScriptedAlchemy wants to merge 1 commit into
masterfrom
cursor/prove-source-edit-rollback-c95d
Closed

ScriptedAlchemy wants to merge 1 commit into
masterfrom
cursor/prove-source-edit-rollback-c95d

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • Prove tracedecay_source_edit_rollback through the production MCP source-edit server, not the catalog schema.
  • A completed move_symbol restores the exact preimage bytes, deletes the file the move created, and replays the same effect id.
  • Stale workspace bytes, 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.rs exercises the daemon-owned MCP dispatch and asserts literal file bytes and tool payloads.
  • Registers that module on the test-transport MCP 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_test
  • cargo nextest run --workspace --no-fail-fast passes
  • cargo clippy has no new warnings
  • No production code changed; manual MCP host session is the suite above

Checklist

  • CHANGELOG.md updated (under [Unreleased] if no version bump)
  • No secrets, credentials, or .env files included
  • Breaking changes documented (if any)
Open in Web Open in Cursor 

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>
@changeset-bot

changeset-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 34c96fb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants