Skip to content

feat(repo-map): add budgeted local code understanding#644

Open
luoye520ww wants to merge 1 commit into
KunAgent:developfrom
luoye520ww:codex/repo-map-local-understanding
Open

feat(repo-map): add budgeted local code understanding#644
luoye520ww wants to merge 1 commit into
KunAgent:developfrom
luoye520ww:codex/repo-map-local-understanding

Conversation

@luoye520ww

Copy link
Copy Markdown
Collaborator

Summary

Add a first-class repo_map tool that gives Kun a compact, query-ranked view of an unfamiliar local codebase before broad read/grep passes.

Changes

  • discover tracked and non-ignored workspace files through Git, with a safe filesystem fallback for non-Git folders
  • skip generated/dependency/nested-repository directories and enforce a configurable scan budget
  • extract symbols and imports across common languages, including camelCase/snake/kebab tokenization
  • rank files with BM25-style relevance, entrypoint/core-path signals, and Git working-tree/recent-commit recency
  • cache short-lived indexes by workspace/target/Git HEAD and expose cache/backend/truncation diagnostics
  • make repo_map available to normal, plan, and read-only subagent tool policies
  • add real-filesystem tests for ranking, symbol/import extraction, ignored directories, and cache reuse

Tests

  • npm.cmd --prefix kun test -- src/adapters/tool/builtin-repo-map-tool.test.ts src/adapters/tool/builtin-tool-types.test.ts
  • npm.cmd --prefix kun run typecheck
  • npm.cmd --prefix kun run build
  • focused ESLint on changed files
  • smoke on this repository: 1,073 Git-visible files indexed in about 2.4s; MCP/runtime files ranked first for runtime mcp reconnect reliability

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