You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A config file living in a subdirectory of the Java tree resolved
inconsistently between the CLI and the MCP server, so no single
index_dir value worked for both. Two compounding bugs:
1. _resolve_index_dir_path resolved a YAML `index_dir` relative to the
already-resolved `source_root`, while `source_root` itself resolved
relative to the config file's directory. A `../` in index_dir was
re-applied on top of source_root and overshot by one level (the
"init indexes ~/" symptom). YAML index_dir now resolves against the
config file's directory, the same base as source_root. CLI/env
index_dir and the default stay source_root-relative (unchanged).
2. server.main() passed source_root=_project_root() (the walk-up-
discovered config dir) to resolve_operator_config, routing into the
branch that treats it as an explicit override and skips the YAML
source_root field. The CLI passes source_root=None, which honors the
field -- so the same config produced a different effective root for
init vs MCP (the "mcp can't find the index" symptom). main() now
passes _source_root_for_operator_config() (env-or-None), so the MCP
server honors YAML source_root exactly like the CLI;
JAVA_CODEBASE_RAG_SOURCE_ROOT still wins when set.
With both fixes a config in my-context/ next to
source_root: ../
index_dir: ../.java-codebase-rag
resolves identically for init and the MCP server.
Docs: CONFIGURATION.md index_dir base comment + tips updated. No
ontology/embedding change; existing indexes remain valid.
Co-Authored-By: Claude <noreply@anthropic.com>
| `index_dir` | partial | `~` expanded; `$VAR` is NOT expanded. Relative paths resolve against `source_root`. |
222
+
| `index_dir` | partial | `~` expanded; `$VAR` is NOT expanded. A YAML relative path resolves against the config file's directory (same base as `source_root`); the default `./.java-codebase-rag` sits beside the resolved `source_root`. |
221
223
| `embedding.model` (when path-shaped) | yes | Path-shape = starts with `/`, `./`, `../`, `~`, or contains `$`. Plain `org/name` is treated as a hub id and passed through. Applies to the value after CLI > env > YAML > default precedence. Long-lived MCP hosts also apply the same expansion when reading `SBERT_MODEL` from the process environment (so table metadata and search agree with `index_common` defaults). |
| `microservice_roots[*]` | no | Each entry is a directory **name** relative to `source_root`, not an arbitrary path. |
224
226
| Brownfield `path:` / `topic:` values | no | These are URL paths and Kafka topic names, not filesystem paths. Literal characters preserved. |
225
227
226
228
**Tips & gotchas:**
227
229
228
-
- **The file must be at `source_root`**, not in `$HOME`. The MCP server reads `JAVA_CODEBASE_RAG_SOURCE_ROOT` to find it; the CLI uses `--source-root` (else cwd).
230
+
- **The config file may live anywhere under your project, including a subdirectory of the Java tree.** Both the CLI (`init` / `increment` / `reprocess`) and the MCP server walk up from cwd to find `.java-codebase-rag.yml`, then resolve `source_root` and `index_dir` relative to the config file's directory. So a config living in `my-context/` next to `source_root: ../` and `index_dir: ../.java-codebase-rag` resolves identically for the CLI and the MCP server. Keep the file under your project (not `$HOME`); set `JAVA_CODEBASE_RAG_SOURCE_ROOT` (MCP) or `--source-root` (CLI) only to override the discovered location.
229
231
- **Don't commit secrets** into this YAML — it sits next to your source tree and is read by every operator who clones it.
230
232
- **Rebuild after editing brownfield overrides.** Run a full `java-codebase-rag reprocess` (no flags) so Lance and Kuzu stay coherent, or use `--graph-only` / `--vectors-only` when you know only one store needs invalidation. Editing `embedding.model` requires a vector rebuild (`reprocess` or `--vectors-only`).
231
233
- **Diagnose what's loaded.** `java-codebase-rag meta` prints the resolved config and each value's `*_source` (`cli` / `env` / `yaml` / `default`) — see `embedding_model_source`, `embedding_device_source`, `index_dir_source`.
0 commit comments