Skip to content

feat(mcp): history_for and history_search replace eleven history tools - #1449

Merged
skakri merged 2 commits into
mainfrom
feat/mcp-history-tools
Sep 23, 2026
Merged

skakri merged 2 commits into
mainfrom
feat/mcp-history-tools

Conversation

@skakri

@skakri skakri commented Sep 23, 2026

Copy link
Copy Markdown
Member

Third slice of #1440. Stacked on #1442.

Why. An agent asking "why is this code like this?" had eleven tools, split by target type (path, symbol, chunk, commit) and source (git, tracker) rather than by the question.

New tools

  • history_for — exactly one target: a symbol (symbol/ref/id), a path, a chunk_id or a commit. Returns { commits, blame, tracker } for the parts that target supports (symbol/path → commits, tracker; chunk → blame, tracker; commit → tracker, with fallback). include narrows; naming a part the target lacks is an error that names what it does support.
  • history_search — { query, source }, source ∈ commits, changes (messages + the files they changed), issues, rationale.

Both dispatch to the handlers they replace, so they cannot drift from the old tools' answers.

Deprecation. The eleven old names stay callable for one release, are no longer listed, and (TOON output) carry a separate content block naming the replacement call — payload unchanged; --json output stays pure JSON.

Docs and skills move in the same change, since clients only let a model call listed tools: using-rag-rat (its tool table also marks what now needs the admin/graph toolset), dream-review, README, docs/mcp-tools.md, docs/distillation.md.

Effect: the default list is 24 tools / 33.8 KB (33 / 38.0 KB after #1442).

Tests (each mutation-checked): each target returns its parts and history_for {path}'s commits equal git_history_for_path's; ambiguous targets and unsupported parts are refused; each history_search source routes to its search (on a fixture with a real commit, so the commit searches differ — issues vs rationale both answer [] without a tracker cache, noted in the test); a deprecated name answers with a note in TOON and pure JSON under --json. MCP and CLI suites pass; clippy clean.

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

SCIP oracle — resolution report

Heuristic→compiler edge resolution per corpus. Δ compares resolved-after to the main baseline (only when the corpus profile + tool version match).

corpus tool edges resolved (heuristic → compiler) precision recall monikers Δ vs main
c-libuv scip-clang 12894 37.9% → 48.6% 90.1% 55.3% 679 +0.0pp
cpp-yaml scip-clang 9423 43.2% → 72.9% 82.5% 40.9% 1055 +0.0pp
py-django scip-python 12937 28.8% → 73.5% 96.7% 84.1% 3701 +0.0pp
py-rich scip-python 8383 27.6% → 92.3% 95.0% 81.3% 1196 +0.0pp
rust-time rust-analyzer 11040 37.6% → 56.9% 82.2% 83.6% 574 +0.0pp
ts-rxjs scip-typescript 7875 39.6% → 94.9% 87.3% 77.4% 631 +0.0pp

resolved = Exact/Syntactic + compiler upgrades + resolved-external, over edge candidates with a callee range. precision/recall are the oracle eval metrics.

Refs #1440 (slice 3).

An agent asking "why is this code like this?" had eleven tools to choose
from, split by target type (path, symbol, chunk, commit) and source (git,
tracker) rather than by the question. Two now cover them:

- history_for: exactly one target — a symbol (symbol / ref / id), a path,
  a chunk_id or a commit — and returns { commits, blame, tracker } for the
  parts that target supports; include narrows, and naming a part the
  target lacks is an error naming what it does support.
- history_search: { query, source } with source commits, changes (commit
  messages plus the files they changed), issues or rationale.

Both dispatch to the handlers they replace, so their answers cannot drift
from the old tools'. The eleven old names stay callable for one release
but are no longer listed, and every result from one carries a separate
content block naming the replacement call; the payload is unchanged.

Because clients only let a model call listed tools, the using-rag-rat and
dream-review skills, README, docs/mcp-tools.md and docs/distillation.md
move to the new names in the same change; the skill's tool table also
marks which tools now need the admin or graph toolset.
A --json client may join the text blocks before parsing; the prose note
would break the JSON it expects. Like the stale-memory nudge, it is TOON
only.
@skakri
skakri force-pushed the feat/mcp-history-tools branch from 9bf1393 to 7bd0517 Compare September 23, 2026 20:09
@skakri
skakri merged commit 4596f50 into main Sep 23, 2026
20 checks passed
@skakri
skakri deleted the feat/mcp-history-tools branch September 23, 2026 20:10
@codecov

codecov Bot commented Sep 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 10 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/rag-rat-mcp/src/tools/handlers.rs 87.80% 10 Missing ⚠️

📢 Thoughts on this report? Let us know!

@skakri skakri mentioned this pull request Sep 23, 2026
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.

1 participant