Skip to content

fix(index): resolve Rust workspace root consistently; honest incremental status - #528

Merged
ajianaz merged 1 commit into
developfrom
fix/522-project-root-mismatch
Aug 27, 2026
Merged

fix(index): resolve Rust workspace root consistently; honest incremental status#528
ajianaz merged 1 commit into
developfrom
fix/522-project-root-mismatch

Conversation

@ajianaz

@ajianaz ajianaz commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Fixes #522

What

  • resolve_project_root prefers a Cargo.toml declaring [workspace], still honors .cora.yaml overrides first, and never climbs past a .git boundary (unrelated parent workspaces cannot hijack resolution)
  • Incremental no-op re-runs print "Index up to date" plus stored totals
  • MCP index_status carries a root-mismatch hint listing other roots with data

Why

Running cora index inside a workspace member crate resolved that crate's plain Cargo.toml as the project root, while MCP sessions resolved the workspace root — two different project rows, so index_status silently reported total_symbols: 0 despite a populated DB. Incremental no-op re-runs also printed a confusing "Indexed 0 symbols from 0 files" line.

Testing

  • New regression tests: workspace-root preference, .cora.yaml precedence, .git boundary stop, incremental count preservation, mismatch hint
  • Full suite green (895 unit + integration); cargo fmt clean; clippy diff vs develop shows zero new findings
  • End-to-end smoke: second run prints "✓ Index up to date (132 files unchanged)" + stored totals

All commits signed-off (DCO).

…tal status

Running 'cora index' inside a workspace member crate resolved that crate's
plain Cargo.toml as the project root, while MCP sessions resolved the
workspace root — two different project rows, so index_status silently
reported total_symbols: 0 despite a populated DB (#522).

- resolve_project_root now prefers a Cargo.toml declaring [workspace],
  still honors .cora.yaml overrides first, and never climbs past a .git
  boundary so unrelated parent workspaces cannot hijack resolution
- incremental no-op re-runs now print 'Index up to date' plus stored
  totals instead of a confusing 'Indexed 0 symbols from 0 files'
- MCP index_status carries root-mismatch hint listing other roots with
  data when the resolved project has zero symbols

Regression tests: workspace-root preference, .cora.yaml precedence,
.git boundary stop, incremental count preservation, mismatch hint.

Signed-off-by: ajianaz <ajianaz@users.noreply.github.com>
@ajianaz
ajianaz merged commit d64d29a into develop Aug 27, 2026
17 of 18 checks passed
@ajianaz
ajianaz deleted the fix/522-project-root-mismatch branch August 27, 2026 12:51
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.

index: incremental re-run reports 0 symbols / 0 files; MCP index_status shows total_symbols 0

1 participant