Repository navigation
explore: tell the agent which repositories the graph holds parsed - #1758
Merged
Merged
Conversation
An explore run with repositories checked out never searched the graph (swarm38 explore 1791645592048: 15 fulltext_search, 0 graph calls), though the swarm's graph holds those repositories parsed. New seeded step explore/repositories — repo_agent's prependRepoInfo as a step: MATCH (r:Repository), normalized to owner/name, compared with the checkouts — whose note replaces the prompt's repo line: search the graph first for an ingested repository, read the files for one only on disk, and name what the graph holds that was not checked out. No default checkouts. Bumps strut to a54eb43 (strut#136: graph read step descriptions).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
An
explorerun with repositories checked out never touched the graph. Swarm38 run1791645592048made 15fulltext_searchcalls, 13 file views and 0 graph calls. Meanwhile runs withoutreposdid search, and a typedgraph-search(Function,File,Endpoint) went straight toverifySphinxTokenandgetUserIdwith their descriptions. The prompt only said "Repositories checked out in your working directory", and nothing told the agent the graph holds those same repositories, parsed.What
New seeded step
explore/repositories:repo_agent'sprependRepoInfo(mcp/src/repo/index.ts) as a step. It runsMATCH (r:Repository), normalizessource_link || nametoowner/namethe waynormalizeRepoRefdoes, and compares against the checkouts case-insensitively. It returns{ graph: [{ repo, ref_id }], checkedOut, note }. The note says, per repository:fulltext_searchand the file tool.Each graph repository carries its
Repositoryref_id, whosedocumentationis an overview.error, and the note says the list couldn't be read (not that the graph holds none).strut), with strut'sgraphCtxinlined so it shares the graph steps' cached backend.explore.yaml: the step runs aftercheckouts, fed the checkouts' canonical names, and{{ repositories.note }}replaces the repo line in the prompt. The system prompt's graph sentence now names the code node types.No default checkouts. A graph may hold 10 repos while one matters, so the graph-only ones are only named.
Strut bumped to
a54eb43(stakwork/strut#136):graph-searchno longer describes itself as searching strut metadata only, and names the code types plus thetypefilter.Tests
explore/seed.test.ts: the skeleton includes the new step; the prompt's note in each case (none, files only, both, graph only);repoRefandrepoNoteunit tests. A fake stands in for the step there, because the real one opens a backend on whatever Neo4j is at localhost:7687.seeded-steps.test.ts: the step loads from a materialized workspace.Repositorynode returned the expected note, and against an unreachable Neo4j returnederrorwithout failing.npm run test:node: 890 pass, 0 fail.tsc --noEmitclean.