Skip to content

test(mcp): prove tracedecay_str_replace behavior - #1717

Closed
ScriptedAlchemy wants to merge 2 commits into
masterfrom
cursor/prove-str-replace-behavior-d5ba
Closed

ScriptedAlchemy wants to merge 2 commits into
masterfrom
cursor/prove-str-replace-behavior-d5ba

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • Prove tracedecay_str_replace through the production MCP tool dispatch, not a stand-in editor.
  • Assert the file bytes and the response text a caller observes: unique replacement, dry-run preview, exact retry, and refusals for non-unique matches, paths outside the worktree, and a stale preview digest.

Motivation

The public contract is one exact string swap. Existing edit tests mix this tool with other editors and check fragments of the message. These tests call only tracedecay_str_replace and lock the observable result.

Changes

  • crates/tracedecay/tests/mcp_suite/mcp_handler_test/str_replace_behavior_test.rs exercises the live call_tool_for_test path.

Test plan

  • cargo test -p tracedecay --test mcp_suite --features test-transport str_replace_behavior_test -- --test-threads=1 reports the new tests passed (non-zero count)
  • No production code changes
  • Do not merge

Checklist

  • No secrets, credentials, or .env files included
  • CHANGELOG.md not updated (tests only)
  • No breaking changes
Open in Web Open in Cursor 

Call the production MCP dispatch for one unique replacement, refusals,
and stale preview state, and assert the file bytes and response text.

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: 96d7da2

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

…place-behavior-d5ba

# Conflicts:
#	crates/tracedecay/tests/mcp_suite/mcp_handler_test.rs
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Closing as superseded. A sibling change proving the same tool landed first as #1701.

Evidence from the triage: git log origin/master -- mcp_handler_test/str_replace_behavior_test.rs shows 383ca3f/4faeffbb9d/ff9daac008 from cursor/prove-str-replace-behavior-e3e0 = merged #1701 (also #1723); master file already has str_replace_writes_the_unique_span_and_reports_the_completed_edit, _dry_run_previews_the_exact_diff_without_writing, _reports_a_missing_span_and_leaves_the_file, _refuses_an_ambiguous_span_and_leaves_the_file, _apply_without_preview_state_is_refused

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