Skip to content

fix walk-up discovery to also detect index directory#285

Merged
HumanBean17 merged 2 commits into
masterfrom
bugfix/dirs-hierarchy
Jun 7, 2026
Merged

fix walk-up discovery to also detect index directory#285
HumanBean17 merged 2 commits into
masterfrom
bugfix/dirs-hierarchy

Conversation

@HumanBean17

Copy link
Copy Markdown
Owner

Summary

  • discover_project_root() walk-up only looked for .java-codebase-rag.yml config files, missing .java-codebase-rag/ index directories
  • This caused MCP tools to fail when started from a microservice subdirectory — walk-up returned None, fell back to cwd, found no index
  • Empty .java-codebase-rag/ directories are skipped to avoid stale artifacts from falsely anchoring discovery

Test plan

  • 4 new tests: non-empty index dir discovery, empty dir skipped, config beats index dir, both markers at same level
  • All 16 config tests pass
  • 182/183 broader tests pass (1 pre-existing failure: missing pytest-asyncio)
  • Manual: start MCP server from tests/bank-chat-system/chat-core/ and verify tools work

🤖 Generated with Claude Code

HumanBean17 and others added 2 commits June 7, 2026 17:17
discover_project_root() only looked for .java-codebase-rag.yml config
files, missing .java-codebase-rag/ index directories. This caused MCP
tools to fail when started from a microservice subdirectory because
walk-up returned None and fell back to cwd (no index there).

Empty index directories are skipped to avoid stale artifacts from
falsely anchoring discovery.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
microservice_for_path walks _bounded_parents which excludes the path
itself. When cwd is exactly the microservice root directory (the most
common case), it was never checked for a build marker and auto-scope
returned None. Pass a synthetic child path so cwd appears in the
parent walk.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@HumanBean17 HumanBean17 force-pushed the bugfix/dirs-hierarchy branch from 41badbe to de552a0 Compare June 7, 2026 14:44
@HumanBean17 HumanBean17 merged commit 263935f into master Jun 7, 2026
1 check passed
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