Entry point for Cursor CLI agents (and other agentic tools) working
on this repo. Detailed guidance lives in .cursor/rules/*.mdc —
those files are auto-loaded by Cursor. This file is a flat summary
for tools that don't read .cursor/rules/.
README.md— feature surface, env vars, ranking, capabilities, MCP tool list (nowsearch/find/describe/neighbors), CLI ops (java-codebase-rag --help), and "Re-index required" callouts.ontology_versionis currently 12 (HTTP brownfield rename +CodebaseHttpMethodenum + inbound HTTP layer-C replace; see README graph section).docs/JAVA-CODEBASE-RAG-CLI.md— operator guide for thejava-codebase-ragCLI (init/increment/reprocess/erase,meta,tables,diagnose-ignore,analyze-pr; one-release hidden verb alias ofreprocesswith stderr deprecation only — see that doc).CODEBASE_REQUIREMENTS.md— Java-repo assumptions and tuning map.propose/andplans/(plus theircompleted/subdirs) — in-flight scope and the rationale behind current design.- Active proposes:
TIER2-INCREMENTAL-REBUILD-PROPOSE.md(Kuzu diff-driven rebuild),RANKING-MICROSERVICE-PROPOSE.md,ENHANCED-ROLE-RECOGNITION-PROPOSE.md,INDEX-AUTO-MODE-PROPOSE.md(paired with TIER2 — decision engine for incremental vs full),DEFERRED-REST-CLIENT-MIGRATION-PROPOSE.md,PRODUCT-VISION.md. - Active plans:
PLAN-POST-TIER1B-FOLLOWUPS.md(PR-E1/PR-E2 — deferred catches collected from PR-D1/D2/D3 reviews). - Completed (Tier 1 + Tier 1B):
propose/completed/TIER1-COMPLETION-PROPOSE.md,propose/completed/TIER1B-HTTP-ASYNC-EDGES-PROPOSE.md,plans/completed/PLAN-TIER1-COMPLETION.md,plans/completed/PLAN-TIER1B-COMPLETION.md,plans/completed/CURSOR-PROMPTS-TIER1.md,plans/completed/CURSOR-PROMPTS-TIER1B.md. The two CURSOR-PROMPTS files are kept as reference templates for future per-PR Cursor work. - Older completed:
propose/completed/CALL-GRAPH-PROPOSE.md,propose/completed/DESCRIBE-MEMBER-EDGE-ROLLUP-PROPOSE.md,plans/completed/PLAN-DESCRIBE-MEMBER-EDGE-ROLLUP.md,propose/completed/MCP-API-V2-REDESIGN-PROPOSE.md(four-tool MCP +java-codebase-ragCLI),plans/completed/PLAN-CALL-GRAPH.md,plans/completed/PLAN-CAPABILITIES-MODEL.md,plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES.md,plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md,plans/completed/PLAN-COCOINDEX-SYMLINK-FIX.md,plans/completed/PLAN-ENUM-ANNOTATION-FIXES.md,plans/completed/PLAN-REMOTE-PROJECT-INDEXING.md,propose/completed/LIST-CLIENTS-MCP-TOOL-PROPOSE.md,plans/completed/PLAN-LIST-CLIENTS-MCP-TOOL.md,plans/completed/CURSOR-PROMPTS-LIST-CLIENTS-MCP-TOOL.md. Read these when you need the why behind current code.
- Active proposes:
tests/README.md— testing philosophy.
Read these directly. Don't rely on rule files to mirror them.
- No backward-compatibility obligation —
.cursor/rules/breaking-changes.mdc. Prefer removals and schema updates over shims. - Propose-then-implement for non-trivial features. Drop a short
markdown propose under
propose/, reference it from the PR, move it topropose/completed/once landed. - Don't overfit to the
tests/bank-chat-system/fixture. It is a deterministic corpus, not a model of production. Assert on invariants, not exact counts. Don't special-case the fixture in production code. server.pyis stdio MCP. Nothing reachable from a tool handler may write to stdout. Diagnostics go to stderr.- Single source of truth for roles, capabilities, client kinds,
call strategies, and call match outcomes is
java_ontology.py. No string literals sprinkled elsewhere. Current valid sets:VALID_ROLES,VALID_CAPABILITIES,VALID_CLIENT_KINDS,VALID_HTTP_CALL_STRATEGIES,VALID_ASYNC_CALL_STRATEGIES,VALID_HTTP_CALL_MATCHES. - Brownfield overrides are first-class. Annotation-driven
BrownfieldOverrides(route, role, capability, http client, async producer) plus their@CodebaseRoute/@CodebaseHttpClient/@CodebaseProducersource-stub equivalents must keep working — they are the only path to making this tool usable on legacy codebases. New auto-detection logic must compose with brownfield (last layer wins), never replace it. Seeplans/completed/PLAN-TIER1B-COMPLETION.md§ "Caller-side composition divergence" for the one intentional exception (caller-side option-b replacement rule for HTTP_CALLS / ASYNC_CALLS). - Schema changes require a reindex — update the README
"Re-index required" callout and bump
ontology_versionwhen enrichment semantics change.
- Branch from
master. Branch names:cursor/<topic>(CLI work),plan/<name>(in-progress propose),feat/<topic>andchore/<topic>for landed-feature work. - Commit messages: present tense, imperative, lowercase first word.
- Always open a PR; never push to
master. - Run
.venv/bin/ruff check .and.venv/bin/python -m pytest tests -vbefore pushing. - Exception for isolated automation-only changes: if edits are limited to
automation/cursor_propose_only/**(plus optional references to that workflow in docs), fulltests -vis not required. Run:.venv/bin/ruff check ..venv/bin/python -m pytest automation/cursor_propose_only/tests -q
- Heavy indexer tests:
JAVA_CODEBASE_RAG_RUN_HEAVY=1(seetests/README.md).
When picking up a per-PR Cursor task prompt (e.g. one of the entries
under plans/CURSOR-PROMPTS-<topic>.md; see
plans/completed/CURSOR-PROMPTS-TIER1B.md as the canonical reference
template):
- Treat the prompt's Out of scope list as binding. Sentinel grep
patterns in the prompt must return zero on
git diff master..HEAD. - Implement deliverables in the listed order; don't reshape the PR.
- Match the prompt's expected test count and named tests verbatim.
- PR description must include: scope statement, manual evidence (with the exact command from the prompt), test count, and intentional design divergences flagged.
- No drive-by lint fixes (unused imports, formatting nits in unrelated files). They violate the per-PR scope contract even when they look harmless.
This is a self-contained Python project — no external services (no Postgres, Kafka, Docker) are needed. All storage (Kuzu, LanceDB, CocoIndex state) is embedded/file-based.
- Python 3.11+ with
.venvat repo root. The update script creates the venv and installs deps if missing. .venv/binmust be onPATHfor CLI tests (test_java_codebase_rag_cli.pyusesshutil.which("java-codebase-rag")). The update script handles this via~/.bashrc.- The package must be installed in editable mode
(
pip install -e .) so thejava-codebase-ragCLI entry point is registered. The update script handles this.
Standard commands per README.md § 1 and AGENTS.md § Workflow:
.venv/bin/ruff check .
.venv/bin/python -m pytest tests -vHeavy (CocoIndex + LanceDB e2e) tests are gated behind
JAVA_CODEBASE_RAG_RUN_HEAVY=1 and download the embedding model on
first run. They are not required for normal development.
Build the Kuzu graph from the test fixture and inspect it:
rm -rf /tmp/check && .venv/bin/python build_ast_graph.py \
--source-root tests/bank-chat-system \
--kuzu-path /tmp/check/code_graph.kuzu --verbose
.venv/bin/java-codebase-rag meta \
--source-root tests/bank-chat-system --index-dir /tmp/checkThe MCP server (server.py) is stdio-based and is not started as a
long-running dev server — it is invoked by MCP hosts (Claude Desktop,
Claude Code) directly.