Skip to content

test(mcp): prove tracedecay_lcm_expand_query behavior - #1639

Merged
ScriptedAlchemy merged 5 commits into
masterfrom
cursor/prove-lcm-expand-query-937b
Sep 19, 2026
Merged

ScriptedAlchemy merged 5 commits into
masterfrom
cursor/prove-lcm-expand-query-937b

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Proves tracedecay_lcm_expand_query through MCP tools/call on an in-process McpServer, the same handler a host calls.
  • A stored session returns that session's message and synthesis prompt. The hit is status: partial with omitted: 1 because the matched record's coverage is unknown, not a clean success.
  • A query that only exists in the other session returns the literal no-match answer, status: ok, and zero coverage.
  • A blank prompt and a numeric node id are the same typed invalid-request refusal, not an empty success.

Motivation

The tool needed a caller-visible proof: one concrete input, the MCP tools/call path, and a literal payload. Existing expand-query tests mostly assert presence, containment, or internal runtime helpers.

Changes

  • crates/tracedecay/tests/mcp_suite/mcp_handler_test/expand_query_behavior.rs drives tracedecay_lcm_expand_query on two seeded sessions and compares the stable payload to literal JSON. Anchor ids and the authorized store path are removed because they are process-local identity; coverage stays in the comparison.

Test plan

  • scripts/require-exact-test.sh cargo test -p tracedecay --features test-transport --test mcp_suite mcp_handler_test::expand_query_behavior::lcm_expand_query_returns_the_asked_session_or_the_literal_miss -- --exact (1 passed)
  • CI clippy / repository gates
  • Tested manually (describe below if applicable)

The manual proof is the MCP server call inside the test above: tools/call on tracedecay_lcm_expand_query against an in-process McpServer.

Checklist

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

@changeset-bot

changeset-bot Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b0cebc4

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

cursoragent and others added 2 commits September 18, 2026 08:10
Call the MCP tool with two stored sessions and assert the literal
match, cross-session miss, and invalid-request payloads.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
The MCP payload serializes absent node, source, and store identity as
null. The literal expected hit must include those fields.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/prove-lcm-expand-query-937b branch from 7d83ac0 to 050387d Compare September 18, 2026 08:14
A stored hit is partial because the matched record's coverage is
unknown. A cross-session miss is the literal no-match with zero coverage.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@ScriptedAlchemy
ScriptedAlchemy marked this pull request as ready for review September 18, 2026 09:00
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

cursoragent and others added 2 commits September 18, 2026 10:17
The ready-for-review run was cancelled before any job started.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
A hit omits the unknown-coverage record; a miss omits nothing.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@ScriptedAlchemy
ScriptedAlchemy merged commit 2ffc4f6 into master Sep 19, 2026
8 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants