fix(cli): index <path> never rebuilds an ancestor instead - #1689
fix(cli): index <path> never rebuilds an ancestor instead#1689danusha2345 wants to merge 13 commits into
Conversation
…ry#1524) 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.
…it-path # Conflicts: # CHANGELOG.md
…it-path # Conflicts: # CHANGELOG.md
|
Merged current |
…it-path # Conflicts: # CHANGELOG.md
|
Merged current |
…it-path # Conflicts: # CHANGELOG.md
|
Merged current |
…it-path # Conflicts: # CHANGELOG.md
|
Merged current |
…it-path # Conflicts: # CHANGELOG.md
|
Merged current |
…it-path # Conflicts: # CHANGELOG.md
|
Merged current |
…it-path # Conflicts: # CHANGELOG.md
|
Merged current |
…it-path # Conflicts: # CHANGELOG.md
|
Merged current |
…it-path # Conflicts: # CHANGELOG.md
|
Merged current |
…it-path # Conflicts: # CHANGELOG.md
|
Merged current |
…it-path # Conflicts: # CHANGELOG.md
|
Merged current |
|
Superseded by Forge PR #1797, which cherry-picks this fix ( |
|
Superseded by #1797 |
Fixes #1524.
Problem
codegraph index <path>resolved an uninitialized<path>upward to the nearest initialized parent and rebuilt THAT under a normal "Done", never saying which project it actually indexed. From a monorepo package that meant re-indexing the whole container; from a fresh clone beside a stale ancestor, rebuilding the wrong graph.Change
An explicit path names the project to rebuild — it is not a hint to go looking for one. When
<path>has no index the command exits 1, names the ancestor it would have picked, and says how to index<path>on its own. A barecodegraph index(cwd) still resolves upward exactly as before, and so do the query commands, whose upward walk is the right behaviour.Verification
New
__tests__/cli-index-explicit-path.test.tsagainst the built binary: the parent's DB is untouched and no.codegraphappears in the child; an initialized explicit path and a bareindexfrom a subdirectory both still rebuild. Full suite green.🤖 Generated with Claude Code