[PR #5790] [CLOSED] fix(mcp): stop advertising an unreturned operation count for trace_feature #7064

Closed
opened 2026-11-01 21:45:05 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5790
Author: @Soumya95
Created: 10/21/2026
Status: ❌ Closed

Base: main ← Head: fix/trace-feature-operation-count-5507


📝 Commits (1)

  • bf4a769 fix(mcp): stop advertising an unreturned operation count for trace_feature

📊 Changes

2 files changed (+27 additions, -1 deletions)

View changed files

📝 src/contracts/enhancedToolContracts.ts (+1 -1)
📝 tests/boundary/mcp/enhancedTools.traceFeatureCoverage.test.ts (+26 -0)

📄 Description

Summary

trace_feature advertised "operation count" in its tool description, but its output schema and successful results contain no count. Fixes #5507.

Problem and expected behavior

listTools described the result as "observations, operation count, and residual unknowns". The result (structuredContent.normalized_result) has only query, search_mode, matches, references, truncated, residual_unknowns. The description, schema and result should agree. "Operation" has no defined unit, so returning a count would mean inventing a meaning (and a count derived from rows would not measure provider work).

Change and scope

Reworded the description to name the members actually returned ("matches, references, and residual unknowns"). Added a boundary test comparing the advertised description and output-schema members. Intentionally excluded: adding a count, changing trace behavior, and #5503 (string encoding qualifications).

Contribution scope: not applicable (wording/contract fix within an existing tool).

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/contracts/enhancedToolContracts.ts (tool catalog description)
  • Contribution scope fit and linked maintainer decision: not applicable
  • CLI and MCP/tool-catalog contract: trace_feature description text only; input and output schemas unchanged
  • Provider, bridge, target-format, or platform compatibility: none; provider-independent text
  • Evidence, artifact, provenance, or reconstruction contract: unchanged
  • Target selection, authority, upstream behavior, and cleanup details: not applicable
  • Generated metadata: npm run docs:check passed; no catalog change committed

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/mcp/enhancedTools.traceFeatureCoverage.test.ts (new case: description has no unreturned count promise; normalized_result schema members are the six returned)
  • Base reproduction or other evidence: executed. With the description change stashed, the new test fails: expected 'Trace the complete literal query, pre…' not to match /count/i; with it restored, 11/11 pass. The original Hopper MCP reproduction in the issue was not re-run.
  • User-visible CLI/MCP output: not captured against a real provider; the change is catalog text only.
  • Remaining proof gaps: no real Hopper run; other providers untested.

Validation performed

  • npm run build:cached — passed
  • npm run test:focused -- tests/boundary/mcp/enhancedTools.traceFeatureCoverage.test.ts — 11 passed (1 failed on base, as above)
  • npm run check:fast — typecheck and lint passed
  • npm run docs:check — completed; no errors reported
  • npx oxfmt --check on changed files; git diff --check — clean
  • Not run: npm run check:pr, real-provider (Hopper/Ghidra/IDA) workflow
  • Toolchain note: local Node 24.20.0 / npm 11.19.0, not the pinned 24.18.0 / 11.16.0

Compatibility, safety, and release

  • Breaking changes or migration steps: none (description text only)
  • Real Hopper/Ghidra, browser, or OS coverage: none; simulated provider only, real provider not verified
  • Package or release metadata impact: none
  • Security, privacy, process, or containment review: not applicable

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/5790 **Author:** [@Soumya95](https://github.com/Soumya95) **Created:** 10/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/trace-feature-operation-count-5507` --- ### 📝 Commits (1) - [`bf4a769`](https://github.com/morluto/rea/commit/bf4a76950c92b5c492ab686d6946d39be3b16143) fix(mcp): stop advertising an unreturned operation count for trace_feature ### 📊 Changes **2 files changed** (+27 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/contracts/enhancedToolContracts.ts` (+1 -1) 📝 `tests/boundary/mcp/enhancedTools.traceFeatureCoverage.test.ts` (+26 -0) </details> ### 📄 Description ## Summary `trace_feature` advertised "operation count" in its tool description, but its output schema and successful results contain no count. Fixes #5507. ## Problem and expected behavior `listTools` described the result as "observations, operation count, and residual unknowns". The result (`structuredContent.normalized_result`) has only `query`, `search_mode`, `matches`, `references`, `truncated`, `residual_unknowns`. The description, schema and result should agree. "Operation" has no defined unit, so returning a count would mean inventing a meaning (and a count derived from rows would not measure provider work). ## Change and scope Reworded the description to name the members actually returned ("matches, references, and residual unknowns"). Added a boundary test comparing the advertised description and output-schema members. Intentionally excluded: adding a count, changing trace behavior, and #5503 (string encoding qualifications). Contribution scope: not applicable (wording/contract fix within an existing tool). ## Contract and boundary impact - Semantic owner and earliest changed stage: `src/contracts/enhancedToolContracts.ts` (tool catalog description) - Contribution scope fit and linked maintainer decision: not applicable - CLI and MCP/tool-catalog contract: `trace_feature` description text only; input and output schemas unchanged - Provider, bridge, target-format, or platform compatibility: none; provider-independent text - Evidence, artifact, provenance, or reconstruction contract: unchanged - Target selection, authority, upstream behavior, and cleanup details: not applicable - Generated metadata: `npm run docs:check` passed; no catalog change committed Expected effects: - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [x] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `tests/boundary/mcp/enhancedTools.traceFeatureCoverage.test.ts` (new case: description has no unreturned `count` promise; `normalized_result` schema members are the six returned) - Base reproduction or other evidence: executed. With the description change stashed, the new test fails: `expected 'Trace the complete literal query, pre…' not to match /count/i`; with it restored, 11/11 pass. The original Hopper MCP reproduction in the issue was not re-run. - User-visible CLI/MCP output: not captured against a real provider; the change is catalog text only. - Remaining proof gaps: no real Hopper run; other providers untested. ## Validation performed - `npm run build:cached` — passed - `npm run test:focused -- tests/boundary/mcp/enhancedTools.traceFeatureCoverage.test.ts` — 11 passed (1 failed on base, as above) - `npm run check:fast` — typecheck and lint passed - `npm run docs:check` — completed; no errors reported - `npx oxfmt --check` on changed files; `git diff --check` — clean - Not run: `npm run check:pr`, real-provider (Hopper/Ghidra/IDA) workflow - Toolchain note: local Node 24.20.0 / npm 11.19.0, not the pinned 24.18.0 / 11.16.0 ## Compatibility, safety, and release - Breaking changes or migration steps: none (description text only) - Real Hopper/Ghidra, browser, or OS coverage: none; simulated provider only, real provider not verified - Package or release metadata impact: none - Security, privacy, process, or containment review: not applicable ## Author readiness Human owner: <!-- @GitHub-handle --> - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [ ] I declare this PR ready for initial maintainer review. ## Before merge - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:45:05 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7064
No description provided.