Skip to content

The MCP surface is impact, path and tests: search is the agent's own - #1852

Open
swapnilpaliwal-sd wants to merge 15 commits into
apps/integration-0.1.9from
chore/surface-path-impact-only
Open

swapnilpaliwal-sd wants to merge 15 commits into
apps/integration-0.1.9from
chore/surface-path-impact-only

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

What

find(question) is no longer an MCP tool and is no longer advertised on any agent-facing surface: SKILL.md (both copies), AGENTS.md, the rules file, the install block, the CLI help, and the hooks' hints. The surface is impact, path and tests.

Why

Search is the agent's own; offering a search tool gets in its way. The graph's job is what text search cannot do — callers, blast radius, call chains, test selection — and the hooks keep feeding that in where a search falls short. Narrowing the surface also narrows what we optimize.

How

  • mcp/server.py: the find tool is removed; impact, path, tests unchanged.
  • The verb stays dispatched (find is context underneath) for the hooks, the suites and existing callers; it moves from PUBLIC to INTERNAL in tests/surfaces.py, so the CLI help, public_verbs and the typo hint drop it automatically (both are derived from the help block).
  • hooks/orient.py: the two find hints become an impact hint (scope-refused branch) and a path hint (how-question branch). hooks/direct.py drops its find clause.
  • The suites that pin the surface (surfaces, mcp, mcp_docs, mcp_first, manifests, front_door, repo_arg, freshness) now pin the three-tool surface.

Verified

surfaces, manifests, mcp_docs, mcp, freshness, mcp_first (40/40), front_door (17/17) and repo_arg all pass locally; packaging/copies.py --check is clean.

🤖 Generated with Claude Code

swapnilpaliwal-sd and others added 14 commits October 1, 2026 13:46
…hrough an index

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
index: three missing lookup indexes made large-repo queries and warm take minutes
…yable

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
build: export impact facts in the background once the graph is queryable
…k names the error

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
index now warms impact's facts in the background, so a query can arrive before
edge.facts exists. context never exported them and died on a missing file.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
…warm

context: export the graph's facts before reading its edges
…at once

The export had no lock: a query that found the stamp stale while another
process was already writing the same facts (the background warm-up after
index, a second query, several hooks at once) ran the whole export again
beside it. Measured on an 8,619-file Java repository: the first query
after index cost 193 s against 8.8 s warm, and every concurrent query
paid the same again while thrashing the writer.

The first comer now takes <facts>/.exporting and the others wait for its
stamp, then answer from the facts it wrote; a lock whose writer is gone
is taken over. tests/export_singleflight.py pins the wait, the takeover
and the unlock.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
…library staging

A name no graph declares, reached only by text, whose lines include an
import of it is the signature of an unstaged dependency — until now the
answer was indistinguishable from an engine gap, and the fix is one flag
away. One hint line under the [text] rows, only for undeclared names.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
impact/path: one facts export per graph, however many queries arrive at once
…s on 8,619 files

Three wastes, found by timing each exported relation and profiling the
poles standalone:
- site_file() ran one has() and one paths lookup PER CALL, and the
  export calls it for every call edge: 638k round-trips over 319k
  edges. The paths map is now read once per graph (171 s -> 89 s).
- via_base_rows probes field_access per single-target call site, and
  the table had no caller_id index: a 65,797-row scan 5,162 times.
  fa_caller lands with the other build-time indexes (89 s -> 63 s).
- registrations() was computed twice in one export, once for the
  registration relation and again inside reg_key_fact (63 s -> 55 s).

Every fact file is content-identical before and after (two differ in
row order only, written from unsorted sets before this change too).
Tests: java 329/329, python 287/287, facts_cache, latency, freshness,
export_singleflight, front_door.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
impact/path: the facts export stops paying per-row SQL (171 s to 55 s on 8.6k files)
find(question) is no longer offered as an MCP tool or advertised on any
agent-facing surface (SKILL.md, AGENTS.md, the rules file, the install
block, the CLI help, the hooks' hints). Search belongs to the agent; the
graph's job is what search cannot do — callers, blast radius, call
chains, test selection — and the hooks keep feeding that in where a
search falls short. The verb stays dispatched (find is context
underneath) for the hooks, the suites and anyone who already calls it;
it is internal now, not public.

The orientation hook's two find hints become impact and path hints, and
the pre-search directive drops its find clause. The suites that pin the
surface (surfaces, mcp, mcp_docs, mcp_first, manifests, front_door,
repo_arg, freshness) pin the three-tool surface instead.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e CLI surface too

The integration branch removed find from the MCP tools and the agent
docs on its own; those files are taken as they landed. The one
difference kept from this branch: find is not a public CLI verb either
— it moves to INTERNAL (the dispatcher still answers it as context),
so the help, public_verbs, the typo hint and the SKILL.md section drop
it, and tests/surfaces.py pins that.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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