Skip to content

fix: v0.47.1 — gate AST_INDEX_WALK_UP on .git marker + deterministic CLI tests#56

Merged
Shahinyanm merged 1 commit into
masterfrom
fix/worktree-walkup-and-flaky-tests
Jun 24, 2026
Merged

fix: v0.47.1 — gate AST_INDEX_WALK_UP on .git marker + deterministic CLI tests#56
Shahinyanm merged 1 commit into
masterfrom
fix/worktree-walkup-and-flaky-tests

Conversation

@Shahinyanm

Copy link
Copy Markdown
Member

Закрывает два хвоста после 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-мок.

Проверка

  • tsc ✓, build ✓ (agents 0.47.1), npm audit 0
  • полный сьют ×2: 3 failed (только пред-существующие context-mode-detector — реальный локальный .mcp.json; в чистом CI проходят), git-root теперь стабилен.

🤖 Generated with Claude Code

…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>
@Shahinyanm
Shahinyanm merged commit 4dbaf3f into master Jun 24, 2026
3 checks passed
@Shahinyanm
Shahinyanm deleted the fix/worktree-walkup-and-flaky-tests branch June 24, 2026 06:28
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