feat: v0.47.0 — explore tool + ast-index 3.48.1 + rebuild resilience#55
Merged
Conversation
Leverage ast-index 3.48 in token-pilot: - feat(explore): new MCP tool `explore` — one-shot ranked context. Wraps ast-index's `explore --rwr`: ranked symbols + top-file source heads + graph neighbours (callers/subclasses = blast radius via RWR) + related tests, in one compact block. Replaces find_usages → read_symbol → call_tree chaining. Graph on by default; degrades with a clear "requires ast-index >= 3.48" note on an older binary. Client method + types + handler + server registration + tests. - chore(deps): bump @ast-index/cli ^3.44 → ^3.48.1 (TS-indexing fix, rebuild swap-and-restore, memory caps, FUSE-safe canonicalize). npm audit still 0. - fix(buildIndex): trust the binary's swap-and-restore — on rebuild failure use the preserved index instead of throwing and falling back to raw reads. Lock and generic recovery paths unified. Deferred: --local / subtree scoping (multi-repo/worktree) needs a rooting rework. Full suite: +5 new tests; 23 failures unchanged (pre-existing env-only). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…olation Pre-existing CI breakage surfaced while landing 0.47.0 (master CI has been red since the "label savings + efficiency %" badge change): - statusline.test.ts: badge now renders `· saved <N>` (labelled) plus an efficiency `%` for tool-call-backed totals. Updated the 8 stale regexes to match the current format; EFF-bearing cases assert ` \d+%`. - installer.test.ts / index.test.ts: installHook branches on CLAUDE_PLUGIN_ROOT. When another test sharing the vitest worker leaks that env var, the standalone-install assertions failed (sharding-dependent). beforeEach now neutralises it and afterEach restores — deterministic regardless of file-to-worker distribution. No production code change. The 2 git-root tests that flake under parallel load (real `git` subprocess, 3s timeout) are unrelated and pre-existing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Использует новинки ast-index 3.48 в token-pilot, одним релизом 0.47.0.
A — bump @ast-index/cli 3.44 → 3.48.1
TS-indexing fix, rebuild swap-and-restore, memory caps, FUSE-safe canonicalize.
npm audit= 0. Полный сьют без новых фейлов (23 — пред-существующие env-only, идентично master).B — buildIndex доверяет swap-and-restore
На упавшем rebuild берём индекс, который бинарь сохранил (swap-and-restore 3.46+), вместо throw + fallback в сырой Read. Lock- и generic-recovery унифицированы.
D — новый tool
explore⭐Обёртка над
ast-index explore --rwr: ранж-символы + source-головы топ-файлов + graph neighbours (callers/subclasses = blast radius через RWR) + связанные тесты — одним компактным блоком. Заменяет цепочкуfind_usages → read_symbol → call_tree.graphпо умолчанию on,max_filesкап. На старом бинаре — внятное «requires ast-index >= 3.48» вместо молчаливого пусто.Реализация: client-метод + типы +
src/handlers/explore.ts+ регистрация в server.ts/tool-definitions/NAV_TOOLS +validateExploreArgs+ тесты. Score округляется. End-to-end проверен на реальном бинаре 3.48.1.Отложено
C (
--local/subtree) — для multi-repo/worktree. Без subtree-модели рутинга--local= no-op; нужен отдельный заход (ADR), чтобы не ломать только что укреплённыйisMultiRepoParent.Проверка
npm audit0🤖 Generated with Claude Code