Skip to content

fix(cli): index <path> never rebuilds an ancestor instead (#1524) - #1797

Merged
colbymchenry merged 1 commit into
mainfrom
forge/fix-1524-index-explicit-path
Sep 8, 2026
Merged

colbymchenry merged 1 commit into
mainfrom
forge/fix-1524-index-explicit-path

Conversation

@colbymchenry

Copy link
Copy Markdown
Owner

Summary

  • Lands upstream #1689 (danusha2345) onto current main: an explicit codegraph index <path> no longer walks up to rebuild a nearest initialized ancestor under a silent Done.
  • Uninitialized explicit paths now exit 1, name the ancestor resolveProjectPath would have picked, and tell the user how to init the named path. Bare codegraph index (cwd) still resolves upward.
  • Cherry-picked 6674d970 with CHANGELOG resolved for current Unreleased; author danusha2345 preserved.

Fixes #1524

Test plan

  • Linux fail→pass: init parent only; codegraph index . from child exits 1, names parent, no child .codegraph, parent DB untouched
  • npx vitest run __tests__/cli-index-explicit-path.test.ts — 2 passed
  • Agency: do not merge this until ready; close fix(cli): index <path> never rebuilds an ancestor instead #1689 as superseded when this lands

An explicit path names the project to rebuild; it is not a hint to go
looking for one. resolveProjectPath's upward walk is right for a query run
from a subdirectory, but for a full re-index it silently rebuilt the
nearest initialized parent's graph when <path> had no index of its own.
Refuse with the parent's path and the way to index <path> itself; a bare
`codegraph index` still resolves from cwd as before.

Fixes #1524
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.

codegraph index <path> silently ignores <path> and rebuilds an ancestor's index when <path> is not initialized

1 participant