fix: v0.47.1 — gate AST_INDEX_WALK_UP on .git marker + deterministic CLI tests#56
Merged
Merged
Conversation
…CLI tests - fix(ast-index): AST_INDEX_WALK_UP is now set only when projectRoot has no `.git` marker of its own. Forcing it on every spawn let a git worktree nested under the main repo walk up past its own gitlink and escape to the parent repo's index, returning the wrong files. Marker computed once (computeHasGitMarker), recomputed on updateProjectRoot. Bare monorepo subdirs (no marker) keep walk-up. - docs(adr): 0002-ast-index-multi-root-scoping — records the walk-up gate (accepted) and the deferred --local/subtree plan to re-enable ast-index on multi-repo parents (proposed). - test: neutralise CLAUDE_PROJECT_DIR + CLAUDE_PLUGIN_ROOT in index/installer setup so git-detection and install assertions are deterministic regardless of which suites share a vitest worker. Mock the git exec seam to drop the real 3s-timeout flake; retry guards the residual race. Type the explore exec mock. Full suite: only the 3 pre-existing context-mode-detector env failures remain (real local .mcp.json; clean in CI). npm audit 0. 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.
Закрывает два хвоста после 0.47.0. Patch-релиз 0.47.1.
fix(ast-index): worktree-walk-up гейт ⭐ (прод-фикс)
exec()ставилAST_INDEX_WALK_UP=1безусловно. Флаг нужен bare-monorepo-subdir (нет.git, нет своего DB), но форс на repo/worktree-root давал баг: git-worktree, вложенный под main-repo (main-repo/.worktrees/feature), уходил вверх мимо своего gitlink и убегал в индекс родителя → чужие файлы. Теперь флаг ставится только когда у projectRoot нет своего.git(dir или worktree-gitlink-файл — оба считаются).computeHasGitMarkerсчитается один раз + пересчёт вupdateProjectRoot.docs(adr): 0002-ast-index-multi-root-scoping
Decision 1 (Accepted) — walk-up гейт. Decision 2 (Proposed, deferred) — subtree-модель +
--local/--subtree, чтобы вернуть ast-index на multi-repo/worktree-родителях вместо отключения (нужен rooting-rework).test: детерминизм под параллельным шардингом
index.test.ts/installer.test.tsчистятCLAUDE_PROJECT_DIR+CLAUDE_PLUGIN_ROOTв setup → git-detection и install-ассерты не флэйкают, когда соседний сьют утёк эти env в общий vitest-воркер. Git-exec замокан (убран реальный 3s-timeout), retry — страховка. Типизирован explore-мок.Проверка
npm audit0.mcp.json; в чистом CI проходят), git-root теперь стабилен.🤖 Generated with Claude Code