java-codebase-rag 0.11.2__tar.gz → 0.12.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. java_codebase_rag-0.12.1/PKG-INFO +35 -0
  2. java_codebase_rag-0.12.1/README.md +22 -0
  3. java_codebase_rag-0.12.1/java_codebase_rag.egg-info/PKG-INFO +35 -0
  4. java_codebase_rag-0.12.1/java_codebase_rag.egg-info/SOURCES.txt +7 -0
  5. java_codebase_rag-0.12.1/java_codebase_rag.egg-info/requires.txt +1 -0
  6. java_codebase_rag-0.12.1/pyproject.toml +27 -0
  7. java_codebase_rag-0.11.2/LICENSE +0 -21
  8. java_codebase_rag-0.11.2/PKG-INFO +0 -331
  9. java_codebase_rag-0.11.2/README.md +0 -285
  10. java_codebase_rag-0.11.2/pyproject.toml +0 -79
  11. java_codebase_rag-0.11.2/src/java_codebase_rag/_fdlimit.py +0 -56
  12. java_codebase_rag-0.11.2/src/java_codebase_rag/_stdio.py +0 -32
  13. java_codebase_rag-0.11.2/src/java_codebase_rag/_version.py +0 -35
  14. java_codebase_rag-0.11.2/src/java_codebase_rag/absence/__init__.py +0 -0
  15. java_codebase_rag-0.11.2/src/java_codebase_rag/absence/absence_diagnosis.py +0 -700
  16. java_codebase_rag-0.11.2/src/java_codebase_rag/absence/absence_types.py +0 -124
  17. java_codebase_rag-0.11.2/src/java_codebase_rag/absence/absence_vocab.py +0 -460
  18. java_codebase_rag-0.11.2/src/java_codebase_rag/analysis/__init__.py +0 -0
  19. java_codebase_rag-0.11.2/src/java_codebase_rag/analysis/pr_analysis.py +0 -563
  20. java_codebase_rag-0.11.2/src/java_codebase_rag/analysis/resolve_service.py +0 -740
  21. java_codebase_rag-0.11.2/src/java_codebase_rag/ast/__init__.py +0 -0
  22. java_codebase_rag-0.11.2/src/java_codebase_rag/ast/ast_java.py +0 -2825
  23. java_codebase_rag-0.11.2/src/java_codebase_rag/ast/brownfield_events.py +0 -58
  24. java_codebase_rag-0.11.2/src/java_codebase_rag/ast/chunk_heuristics.py +0 -62
  25. java_codebase_rag-0.11.2/src/java_codebase_rag/cli.py +0 -1215
  26. java_codebase_rag-0.11.2/src/java_codebase_rag/cli_format.py +0 -85
  27. java_codebase_rag-0.11.2/src/java_codebase_rag/cli_progress.py +0 -94
  28. java_codebase_rag-0.11.2/src/java_codebase_rag/config.py +0 -833
  29. java_codebase_rag-0.11.2/src/java_codebase_rag/eval/__init__.py +0 -1
  30. java_codebase_rag-0.11.2/src/java_codebase_rag/eval/ground_truth.py +0 -100
  31. java_codebase_rag-0.11.2/src/java_codebase_rag/eval/metrics.py +0 -107
  32. java_codebase_rag-0.11.2/src/java_codebase_rag/eval/runner.py +0 -556
  33. java_codebase_rag-0.11.2/src/java_codebase_rag/graph/__init__.py +0 -0
  34. java_codebase_rag-0.11.2/src/java_codebase_rag/graph/build_ast_graph.py +0 -4471
  35. java_codebase_rag-0.11.2/src/java_codebase_rag/graph/graph_enrich.py +0 -1937
  36. java_codebase_rag-0.11.2/src/java_codebase_rag/graph/graph_types.py +0 -224
  37. java_codebase_rag-0.11.2/src/java_codebase_rag/graph/java_ontology.py +0 -465
  38. java_codebase_rag-0.11.2/src/java_codebase_rag/graph/ladybug_queries.py +0 -2213
  39. java_codebase_rag-0.11.2/src/java_codebase_rag/graph/path_filtering.py +0 -477
  40. java_codebase_rag-0.11.2/src/java_codebase_rag/index/__init__.py +0 -0
  41. java_codebase_rag-0.11.2/src/java_codebase_rag/index/java_index_flow_lancedb.py +0 -734
  42. java_codebase_rag-0.11.2/src/java_codebase_rag/index/java_index_v1_common.py +0 -33
  43. java_codebase_rag-0.11.2/src/java_codebase_rag/install_data/__init__.py +0 -0
  44. java_codebase_rag-0.11.2/src/java_codebase_rag/install_data/agents/explorer-rag-cli.md +0 -108
  45. java_codebase_rag-0.11.2/src/java_codebase_rag/install_data/agents/explorer-rag-enhanced.md +0 -152
  46. java_codebase_rag-0.11.2/src/java_codebase_rag/install_data/skills/explore-codebase/SKILL.md +0 -165
  47. java_codebase_rag-0.11.2/src/java_codebase_rag/install_data/skills/explore-codebase-cli/SKILL.md +0 -107
  48. java_codebase_rag-0.11.2/src/java_codebase_rag/installer.py +0 -2188
  49. java_codebase_rag-0.11.2/src/java_codebase_rag/jrag.py +0 -4531
  50. java_codebase_rag-0.11.2/src/java_codebase_rag/jrag_envelope.py +0 -1107
  51. java_codebase_rag-0.11.2/src/java_codebase_rag/jrag_hints.py +0 -204
  52. java_codebase_rag-0.11.2/src/java_codebase_rag/jrag_render.py +0 -926
  53. java_codebase_rag-0.11.2/src/java_codebase_rag/lance_optimize.py +0 -264
  54. java_codebase_rag-0.11.2/src/java_codebase_rag/mcp/__init__.py +0 -0
  55. java_codebase_rag-0.11.2/src/java_codebase_rag/mcp/mcp_hints.py +0 -932
  56. java_codebase_rag-0.11.2/src/java_codebase_rag/mcp/mcp_v2.py +0 -1916
  57. java_codebase_rag-0.11.2/src/java_codebase_rag/mcp/server.py +0 -884
  58. java_codebase_rag-0.11.2/src/java_codebase_rag/pipeline.py +0 -531
  59. java_codebase_rag-0.11.2/src/java_codebase_rag/progress.py +0 -570
  60. java_codebase_rag-0.11.2/src/java_codebase_rag/read_payloads.py +0 -781
  61. java_codebase_rag-0.11.2/src/java_codebase_rag/search/__init__.py +0 -0
  62. java_codebase_rag-0.11.2/src/java_codebase_rag/search/index_common.py +0 -10
  63. java_codebase_rag-0.11.2/src/java_codebase_rag/search/search_lancedb.py +0 -1296
  64. java_codebase_rag-0.11.2/src/java_codebase_rag/search/search_lexical.py +0 -449
  65. java_codebase_rag-0.11.2/src/java_codebase_rag/search/search_scoring.py +0 -523
  66. java_codebase_rag-0.11.2/src/java_codebase_rag/watch/__init__.py +0 -0
  67. java_codebase_rag-0.11.2/src/java_codebase_rag/watch/client.py +0 -230
  68. java_codebase_rag-0.11.2/src/java_codebase_rag/watch/daemon.py +0 -396
  69. java_codebase_rag-0.11.2/src/java_codebase_rag/watch/lock.py +0 -201
  70. java_codebase_rag-0.11.2/src/java_codebase_rag/watch/paths.py +0 -76
  71. java_codebase_rag-0.11.2/src/java_codebase_rag/watch/protocol.py +0 -122
  72. java_codebase_rag-0.11.2/src/java_codebase_rag/watch/server.py +0 -273
  73. java_codebase_rag-0.11.2/src/java_codebase_rag/watch/warm.py +0 -105
  74. java_codebase_rag-0.11.2/src/java_codebase_rag/watch/watcher.py +0 -370
  75. java_codebase_rag-0.11.2/src/java_codebase_rag.egg-info/PKG-INFO +0 -331
  76. java_codebase_rag-0.11.2/src/java_codebase_rag.egg-info/SOURCES.txt +0 -76
  77. java_codebase_rag-0.11.2/src/java_codebase_rag.egg-info/entry_points.txt +0 -4
  78. java_codebase_rag-0.11.2/src/java_codebase_rag.egg-info/requires.txt +0 -24
  79. java_codebase_rag-0.11.2/src/java_codebase_rag.egg-info/top_level.txt +0 -1
  80. java_codebase_rag-0.11.2/tests/test_config_watch.py +0 -164
  81. java_codebase_rag-0.11.2/tests/test_docs_watch.py +0 -76
  82. {java_codebase_rag-0.11.2/src → java_codebase_rag-0.12.1}/java_codebase_rag.egg-info/dependency_links.txt +0 -0
  83. /java_codebase_rag-0.11.2/src/java_codebase_rag/__init__.py → /java_codebase_rag-0.12.1/java_codebase_rag.egg-info/top_level.txt +0 -0
  84. {java_codebase_rag-0.11.2 → java_codebase_rag-0.12.1}/setup.cfg +0 -0
@@ -0,0 +1,35 @@
1
+ Metadata-Version: 2.4
2
+ Name: java-codebase-rag
3
+ Version: 0.12.1
4
+ Summary: Renamed to jrag-cli; this package only depends on jrag-cli. New setups: pip install jrag-cli.
5
+ Author: HumanBean17
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/HumanBean17/jrag
8
+ Project-URL: Repository, https://github.com/HumanBean17/jrag
9
+ Project-URL: Issues, https://github.com/HumanBean17/jrag/issues
10
+ Requires-Python: >=3.11
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: jrag-cli==0.12.1
13
+
14
+ # java-codebase-rag (renamed to `jrag-cli`)
15
+
16
+ This package has been **renamed to [`jrag-cli`](https://github.com/HumanBean17/jrag)**.
17
+
18
+ `java-codebase-rag` remains on PyPI as a thin compatibility shim that depends
19
+ on `jrag-cli` and ships no code of its own. Upgrading an existing install
20
+ pulls `jrag-cli` in transparently:
21
+
22
+ ```bash
23
+ pip install -U java-codebase-rag # installs jrag-cli behind the scenes
24
+ ```
25
+
26
+ For new setups, install the canonical package directly:
27
+
28
+ ```bash
29
+ pip install jrag-cli
30
+ ```
31
+
32
+ The CLI entry points, MCP server, and module layout are unchanged — `jrag`
33
+ and `jrag-mcp` (plus the legacy `java-codebase-rag` / `java-codebase-rag-mcp`
34
+ aliases) are all provided by `jrag-cli`. See
35
+ [HumanBean17/jrag](https://github.com/HumanBean17/jrag) for documentation.
@@ -0,0 +1,22 @@
1
+ # java-codebase-rag (renamed to `jrag-cli`)
2
+
3
+ This package has been **renamed to [`jrag-cli`](https://github.com/HumanBean17/jrag)**.
4
+
5
+ `java-codebase-rag` remains on PyPI as a thin compatibility shim that depends
6
+ on `jrag-cli` and ships no code of its own. Upgrading an existing install
7
+ pulls `jrag-cli` in transparently:
8
+
9
+ ```bash
10
+ pip install -U java-codebase-rag # installs jrag-cli behind the scenes
11
+ ```
12
+
13
+ For new setups, install the canonical package directly:
14
+
15
+ ```bash
16
+ pip install jrag-cli
17
+ ```
18
+
19
+ The CLI entry points, MCP server, and module layout are unchanged — `jrag`
20
+ and `jrag-mcp` (plus the legacy `java-codebase-rag` / `java-codebase-rag-mcp`
21
+ aliases) are all provided by `jrag-cli`. See
22
+ [HumanBean17/jrag](https://github.com/HumanBean17/jrag) for documentation.
@@ -0,0 +1,35 @@
1
+ Metadata-Version: 2.4
2
+ Name: java-codebase-rag
3
+ Version: 0.12.1
4
+ Summary: Renamed to jrag-cli; this package only depends on jrag-cli. New setups: pip install jrag-cli.
5
+ Author: HumanBean17
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/HumanBean17/jrag
8
+ Project-URL: Repository, https://github.com/HumanBean17/jrag
9
+ Project-URL: Issues, https://github.com/HumanBean17/jrag/issues
10
+ Requires-Python: >=3.11
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: jrag-cli==0.12.1
13
+
14
+ # java-codebase-rag (renamed to `jrag-cli`)
15
+
16
+ This package has been **renamed to [`jrag-cli`](https://github.com/HumanBean17/jrag)**.
17
+
18
+ `java-codebase-rag` remains on PyPI as a thin compatibility shim that depends
19
+ on `jrag-cli` and ships no code of its own. Upgrading an existing install
20
+ pulls `jrag-cli` in transparently:
21
+
22
+ ```bash
23
+ pip install -U java-codebase-rag # installs jrag-cli behind the scenes
24
+ ```
25
+
26
+ For new setups, install the canonical package directly:
27
+
28
+ ```bash
29
+ pip install jrag-cli
30
+ ```
31
+
32
+ The CLI entry points, MCP server, and module layout are unchanged — `jrag`
33
+ and `jrag-mcp` (plus the legacy `java-codebase-rag` / `java-codebase-rag-mcp`
34
+ aliases) are all provided by `jrag-cli`. See
35
+ [HumanBean17/jrag](https://github.com/HumanBean17/jrag) for documentation.
@@ -0,0 +1,7 @@
1
+ README.md
2
+ pyproject.toml
3
+ java_codebase_rag.egg-info/PKG-INFO
4
+ java_codebase_rag.egg-info/SOURCES.txt
5
+ java_codebase_rag.egg-info/dependency_links.txt
6
+ java_codebase_rag.egg-info/requires.txt
7
+ java_codebase_rag.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ jrag-cli==0.12.1
@@ -0,0 +1,27 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "java-codebase-rag"
7
+ version = "0.12.1"
8
+ description = "Renamed to jrag-cli; this package only depends on jrag-cli. New setups: pip install jrag-cli."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "MIT"
12
+ authors = [
13
+ { name = "HumanBean17" },
14
+ ]
15
+ dependencies = ["jrag-cli==0.12.1"]
16
+
17
+ [project.urls]
18
+ Homepage = "https://github.com/HumanBean17/jrag"
19
+ Repository = "https://github.com/HumanBean17/jrag"
20
+ Issues = "https://github.com/HumanBean17/jrag/issues"
21
+
22
+ # Metadata-only shim: explicitly ship no modules so setuptools does not perform
23
+ # auto-discovery (a `[tool.setuptools.packages*]` section would imply a module
24
+ # tree the shim does not have). Every console script and importable module
25
+ # lives in the canonical `jrag-cli` dist, pulled in via the dependency above.
26
+ [tool.setuptools]
27
+ py-modules = []
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 HumanBean17
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,331 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: java-codebase-rag
3
- Version: 0.11.2
4
- Summary: MCP server for semantic + structural search over Java codebases
5
- Author: HumanBean17
6
- License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/HumanBean17/java-codebase-rag
8
- Project-URL: Repository, https://github.com/HumanBean17/java-codebase-rag
9
- Project-URL: Issues, https://github.com/HumanBean17/java-codebase-rag/issues
10
- Keywords: mcp,java,rag,code-search,graph,lancedb,ladybug
11
- Classifier: Development Status :: 3 - Alpha
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.11
15
- Classifier: Programming Language :: Python :: 3.12
16
- Classifier: Programming Language :: Python :: 3.13
17
- Classifier: Topic :: Software Development :: Libraries
18
- Classifier: Operating System :: POSIX :: Linux
19
- Classifier: Operating System :: MacOS :: MacOS X
20
- Classifier: Operating System :: Microsoft :: Windows
21
- Requires-Python: >=3.11
22
- Description-Content-Type: text/markdown
23
- License-File: LICENSE
24
- Requires-Dist: cocoindex[lancedb]<2,>=1.0.15; sys_platform != "darwin" or platform_machine != "x86_64"
25
- Requires-Dist: ladybug<0.18,>=0.17.1
26
- Requires-Dist: lancedb<0.36,>=0.34; sys_platform != "darwin" or platform_machine != "x86_64"
27
- Requires-Dist: mcp<2,>=1.27.0
28
- Requires-Dist: numpy<2.5,>=1.26.4
29
- Requires-Dist: pathspec<2,>=1.0.4
30
- Requires-Dist: pyarrow<26,>=23.0.1
31
- Requires-Dist: pydantic<3,>=2.0
32
- Requires-Dist: PyYAML<7,>=6.0.3
33
- Requires-Dist: questionary<3,>=2.0
34
- Requires-Dist: rich<16,>=14
35
- Requires-Dist: sentence-transformers<6,>=5.4.0; sys_platform != "darwin" or platform_machine != "x86_64"
36
- Requires-Dist: tree-sitter<0.26,>=0.25.2
37
- Requires-Dist: tree-sitter-java<0.24,>=0.23.5
38
- Requires-Dist: unidiff<1,>=0.7.3
39
- Requires-Dist: watchdog<7,>=6
40
- Provides-Extra: dev
41
- Requires-Dist: pytest>=7; extra == "dev"
42
- Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
43
- Requires-Dist: pytest-xdist>=3; extra == "dev"
44
- Requires-Dist: ruff>=0.4; extra == "dev"
45
- Dynamic: license-file
46
-
47
- # java-codebase-rag
48
-
49
- A graph-native code intelligence layer for Java microservice estates, surfaced through the **`jrag` CLI** — one command per engineering intent. A **legacy MCP server** (`search` / `find` / `describe` / `neighbors` / `resolve`) is also available for existing setups. Both are thin surfaces over the same **AST Graph**: a deterministic property graph extracted from Java source with tree-sitter, stored **locally** in **LadybugDB** (graph) alongside a **LanceDB** vector index (chunks). There is no server to host and no cloud round-trip — the index lives on your disk and your source never leaves the machine. Both surfaces collapse onto three primitive operations: **locate**, **inspect**, **walk**.
50
-
51
- > **What this is: a GPS for code navigation**, not a reasoning engine.
52
- > Agents use a simple loop:
53
- >
54
- > 1. **Locate** entry nodes (`jrag find`, `jrag search`, or identifier-shaped lookup)
55
- > 2. **Inspect** what a node is (`jrag inspect`)
56
- > 3. **Walk** one hop at a time (`jrag callers` / `callees` / `hierarchy` / …) until enough evidence is gathered
57
- >
58
- > The tool exposes structure and adjacency; the agent owns multi-hop reasoning and stop conditions.
59
-
60
- For the design rationale, the GPS metaphor, and the full ontology, see [`docs/paper/paper.pdf`](./docs/paper/paper.pdf) (architecture report).
61
-
62
- ---
63
-
64
- ## Why this exists
65
-
66
- Generic code-search tools (grep, ctags, vector-only RAG) hit a ceiling on real Java microservice estates: they find files but lose the structure that makes a Spring/JAX-RS system navigable. This project is built around five choices that target that gap.
67
-
68
- - **Hybrid RAG + AST Graph, not either-or.** Semantic recall (LanceDB chunk vectors) and structural navigation (the LadybugDB AST Graph) are composed in one surface. `search` finds candidate nodes by meaning; `neighbors` walks the exact edge you care about (`CALLS`, `IMPLEMENTS`, `INJECTS`, `EXPOSES`, …). The agent picks the right primitive per step instead of being forced into pure-vector or pure-symbol search.
69
-
70
- - **A Java-tuned role model.** Symbols are labelled with stereotypes inferred from Spring and JAX-RS conventions — `CONTROLLER`, `SERVICE`, `REPOSITORY`, `COMPONENT`, `CONFIG`, `ENTITY`, `CLIENT`, `MAPPER`, `DTO`. Agents can ask "list controllers" or "who injects this repository" directly, instead of grep-ing for `@RestController` and hoping for the best. Roles drive both filtering (`find` with a `NodeFilter`) and ranking.
71
-
72
- - **Ranking specialized for Java codebases.** The composite ranker is aware of role, microservice, and FQN structure — not a generic BM25. A search for `"chat ingress"` surfaces controllers before utility classes; a search scoped to one microservice doesn't drown in matches from the other 19. Defaults are tuned on the bank-chat fixture and exposed in `docs/CONFIGURATION.md` for per-repo overrides.
73
-
74
- - **Cross-service resolution + system-level navigation.** `HTTP_CALLS` and `ASYNC_CALLS` edges connect Clients and Producers in one microservice to Routes and Handlers in another, resolved at index time from URL/topic strings + Spring `@FeignClient` / `RestTemplate` conventions. `/who-hits-route`, `/trace-request-flow`, and `/impact-of` use these to answer questions a single-service tool fundamentally can't — "who calls this REST endpoint from outside this service", "trace this Kafka message end-to-end", "if I change this DTO, which services break".
75
-
76
- - **Brownfield annotations as a first-class override.** Real Java estates have hand-rolled HTTP clients, dynamic topic names, reflection-heavy routing. `@CodebaseHttpRoute`, `@CodebaseAsyncRoute`, `@CodebaseHttpClient`, and `@CodebaseProducer` let you pin the truth in source. They have **exclusive priority** — when a symbol is annotated, framework-convention inference is skipped entirely. You get a correct graph on legacy code without rewriting it.
77
-
78
- The rest of this README is the install, the tool/command orientation, and the reference for putting that to work.
79
-
80
- ---
81
-
82
- ## Install
83
-
84
- ```bash
85
- pip install java-codebase-rag
86
- ```
87
-
88
- Python **3.11+** required, on **Linux, macOS, and Windows**. On Linux, Windows, and **Apple Silicon** Macs every native dependency (LanceDB, LadybugDB, CocoIndex) ships a wheel and you get the full semantic + graph search. **Intel Macs (x86_64) install graph-only**: PyTorch ≥2.3 and LanceDB ≥0.26 dropped macOS Intel wheels, so the vector stack is auto-excluded via PEP 508 markers — `pip install java-codebase-rag` works out of the box, the graph layer (`find` / `describe` / `neighbors` / `resolve`) is fully usable, and the `search` tool falls back to **lexical search** over the symbol graph — BM25-ranked over a LadybugDB full-text index (same tool contract, keyword-ranked instead of semantic; an advisory notes the mode). Semantic/vector search needs Apple Silicon, Linux, or Windows. After install, `java-codebase-rag --help` should print the CLI groups.
89
- The package includes the CocoIndex lifecycle dependency used by `init`, `increment`, `reprocess`, and `erase` on platforms that have it (it is absent on Intel Mac).
90
-
91
- ### Interactive setup (recommended)
92
-
93
- Run `java-codebase-rag install` from your Java project root to launch an interactive setup wizard that:
94
-
95
- 1. Detects Java source directories (Maven/Gradle modules)
96
- 2. Configures the embedding model (auto-downloads ~90MB or uses a local path)
97
- 3. Selects agent hosts (Claude Code, Qwen Code, GigaCode)
98
- 4. Deploys MCP registration, skill, and agent artifacts
99
- 5. Generates `.java-codebase-rag.yml` configuration
100
- 6. Runs `init` to build the index
101
-
102
- ```bash
103
- # Interactive mode
104
- java-codebase-rag install
105
-
106
- # Non-interactive mode (for CI/automation)
107
- java-codebase-rag install --non-interactive --agent claude-code
108
- ```
109
-
110
- After `pip install --upgrade java-codebase-rag`, run `java-codebase-rag update` to refresh shipped artifacts and catch up the index (Lance + graph).
111
-
112
- All indexing lifecycle commands (`init`, `increment`, `reprocess`, `install`, `update`) show a unified `Vectors → Optimize → Graph` progress bar on stderr during the index build (powered by `rich`); pass `--quiet` to suppress it.
113
-
114
- ### Manual registration
115
-
116
- If you prefer manual configuration, see [`docs/JAVA-CODEBASE-RAG-CLI.md`](./docs/JAVA-CODEBASE-RAG-CLI.md) for the full CLI reference.
117
-
118
- > **Stability disclaimer.** This package does **not** promise backward compatibility. MCP tool contracts, env vars, Lance/LadybugDB schemas, config files, and Python APIs may change without a deprecation period. Track `main` and rebuild indexes when ontology or embedding settings change.
119
-
120
- ---
121
-
122
- ## Tools & commands at a glance
123
-
124
- `jrag` is the default and recommended surface (`java-codebase-rag install --surface cli`). The **MCP server** (`--surface mcp`) is kept as a **legacy** option for existing setups. Both surfaces walk the same LanceDB vectors + LadybugDB **AST Graph**. Switch an existing install later with `java-codebase-rag update --surface mcp|cli`.
125
-
126
- **CLI surface — `jrag`, one command per engineering intent**
127
-
128
- ```bash
129
- # Orientation
130
- jrag status # index health (ontology version, freshness, counts)
131
- jrag microservices # microservices with resolved type counts
132
- jrag map # counts per kind per service/module
133
- jrag map --by module # group by module instead (--module filters)
134
- jrag conventions # dominant roles + framework tallies
135
- jrag overview chat-core # bundle for a microservice
136
- jrag overview /chat/assign # route flow (inbound callers + outbound CALLS)
137
- jrag overview banking.chat # topic producers + consumers
138
- jrag overview chat-core --as microservice # override auto-detection
139
-
140
- # Locate
141
- jrag find ChatService # exact name/FQN lookup (symbols)
142
- jrag find --role CONTROLLER # filter mode (NodeFilter flags)
143
- jrag inspect ChatService # full node details + edge_summary
144
- jrag outline src/main/.../Foo.java # all symbols declared in a file
145
- jrag imports src/main/.../Foo.java # imports resolved to graph nodes
146
-
147
- # Listings
148
- jrag http-routes # HTTP routes
149
- jrag http-clients # HTTP clients (Feign / RestTemplate / WebClient)
150
- jrag producers # async message producers (Kafka / StreamBridge)
151
- jrag topics # message topics grouped by producer
152
- jrag jobs # scheduled tasks (@Scheduled)
153
- jrag listeners # message listeners (@KafkaListener etc.)
154
- jrag entities # JPA entities
155
-
156
- # Traversals (all resolve-first)
157
- jrag callers ChatService#assign(Request) # who calls me?
158
- jrag callers ChatIngressController # controller: also lists its EXPOSES routes
159
- jrag callees ChatService#assign(Request) # what do I call?
160
- jrag hierarchy AbstractBase # type tree (parents + children)
161
- jrag implementations PaymentProcessor # classes implementing an interface
162
- jrag subclasses AbstractRepository # classes extending a type
163
- jrag overrides Impl#run() # methods this overrides (dispatch UP)
164
- jrag overridden-by Iface#run() # methods overriding this (dispatch DOWN)
165
- jrag dependents PaymentGateway # who injects this type?
166
- jrag dependencies ChatService # types this injects
167
- jrag impact PaymentGateway # fleet-wide blast radius
168
- jrag decompose ChatIngressController#assign # role-waterfall flow
169
- jrag flow /chat/assign # request flow through a route
170
- jrag connection chat-core # cross-service connections
171
-
172
- # Semantic search
173
- jrag search "assign a chat agent" # semantic over Lance (java table)
174
- jrag search "kafka" --table all # java + sql + yaml tables
175
- jrag search "audit" --hybrid # vector + keyword hybrid
176
- jrag search "audit" --offset 5 # paginated
177
- ```
178
-
179
- Every `<query>` command takes human-readable identifiers (FQN / simple name / route path / topic) — never raw node IDs. Output contract, flags, and the resolve-first rule are in [`jrag` — agent CLI](#jrag--agent-cli) below.
180
-
181
- **MCP surface — five tools over stdio (legacy)**
182
-
183
- | Tool | Purpose | Required args |
184
- |---|---|---|
185
- | `search` | Locate nodes by NL / code text. | `query` |
186
- | `find` | Locate nodes by structured filter. | `kind`, `filter` |
187
- | `describe` | Full record + edge counts for one node. | `id` |
188
- | `resolve` | Identifier-shaped lookup (FQN-collision-safe). Returns `one` / `many` / `none`. | `identifier` |
189
- | `neighbors` | Graph walk, one hop. | `ids`, `direction`, `edge_types` |
190
-
191
- Full schemas, `NodeFilter` / `EdgeFilter` semantics, and the hints contract live in [`docs/AGENT-GUIDE.md`](./docs/AGENT-GUIDE.md). Edge types and traversal directions are listed in [`docs/EDGE-NAVIGATION.md`](./docs/EDGE-NAVIGATION.md).
192
-
193
- ### Three-layer architecture
194
-
195
- Layer 1 (storage) → Layer 2 (the `jrag` CLI, **or** the legacy 5-tool MCP) → Layer 3 (skill). The CLI-surface skill **[`/explore-codebase-cli`](./skills/explore-codebase-cli/SKILL.md)** documents the `jrag` CLI; the MCP-surface skill **[`/explore-codebase`](./skills/explore-codebase/SKILL.md)** documents the legacy 5-tool MCP (PR-JRAG-5). See the [architecture diagram in `skills/README.md`](./skills/README.md#three-layer-architecture).
196
-
197
- ---
198
-
199
- ## Configuration
200
-
201
- The operator-facing surface is small: pick an index dir, pick an embedding model, optionally drop a `.java-codebase-rag.yml` at your project root for microservice layout and brownfield overrides.
202
-
203
- | If you want to… | See |
204
- |---|---|
205
- | Set env vars and override precedence | [`docs/CONFIGURATION.md`](./docs/CONFIGURATION.md) §1 |
206
- | Configure microservice roots and embeddings via YAML | [`docs/CONFIGURATION.md`](./docs/CONFIGURATION.md) §2 |
207
- | Understand the graph (nodes, edges, capabilities, ranking) | [`docs/CONFIGURATION.md`](./docs/CONFIGURATION.md) §3 |
208
- | Steer a brownfield Java tree (custom stereotypes, non-Spring stacks) | [`docs/CONFIGURATION.md`](./docs/CONFIGURATION.md) §4 |
209
- | Control which files the indexer walks | [`docs/CONFIGURATION.md`](./docs/CONFIGURATION.md) §5 |
210
- | Check whether your repo fits this tool's assumptions | [`docs/CODEBASE_REQUIREMENTS.md`](./docs/CODEBASE_REQUIREMENTS.md) |
211
-
212
- ---
213
-
214
- ## CLI cheat sheet
215
-
216
- Run `java-codebase-rag --help` to list grouped subcommands. Operator playbook with workflows, exit codes, and env alignment lives in [`docs/JAVA-CODEBASE-RAG-CLI.md`](./docs/JAVA-CODEBASE-RAG-CLI.md).
217
-
218
- | Group | Subcommand | What it does |
219
- |---|---|---|
220
- | Setup | `install` | Interactive setup wizard: config, MCP registration, skill/agent deployment, indexing. |
221
- | Setup | `update` | Refresh shipped artifacts (skill, agent, MCP entry) + incremental Lance/graph catch-up after pip upgrade. |
222
- | Lifecycle | `init` | First-time index. Refuses if artifacts already exist. |
223
- | Lifecycle | `increment` | CocoIndex catch-up + incremental LadybugDB update. `--vectors-only` for Lance only. |
224
- | Lifecycle | `reprocess` | Full Lance + LadybugDB rebuild. `--vectors-only` / `--graph-only` for a single phase. |
225
- | Lifecycle | `erase` | Delete index artifacts. Requires `--yes` or TTY confirm. |
226
- | Introspection | `meta`, `tables`, `diagnose-ignore`, `unresolved-calls` | Health, table listing, ignore-layer diagnostics, receiver-failure call sites. |
227
- | Analysis | `analyze-pr` | Blast-radius / risk from a unified diff. |
228
-
229
- ---
230
-
231
- ## jrag — agent CLI
232
-
233
- `jrag` is a separate console script (alongside `java-codebase-rag`) built for AI
234
- coding agents. It gives the agent **one command per engineering intent** and
235
- takes human-readable identifiers (FQN / simple name / route path / topic) —
236
- never raw node IDs. Every `<query>` command resolves the identifier via
237
- `resolve_v2` as the first step; on `many` it returns candidates and stops, on
238
- `none` it returns `not_found`. Auto-pick is forbidden.
239
-
240
- The default output is compact text (a deliberate divergence from the operator
241
- CLI's TTY heuristic — `jrag` is agent-facing/non-TTY). `--format json` emits the
242
- shared envelope verbatim. Every command emits the same envelope shape:
243
-
244
- ```json
245
- {
246
- "status": "ok",
247
- "nodes": {"com.example.Foo": {"kind": "symbol", "fqn": "com.example.Foo"}},
248
- "edges": [{"edge_type": "CALLS", "confidence": 0.9, "target": "com.example.Bar#baz()"}],
249
- "root": "com.example.Foo",
250
- "agent_next_actions": ["jrag callees com.example.Foo#bar()"],
251
- "truncated": false
252
- }
253
- ```
254
-
255
- No raw graph node id ever appears on either surface: `nodes` is keyed by each
256
- node's natural identifier (FQN for symbols, `METHOD path` for routes,
257
- `member_fqn->target` for clients, `topic:<name>` for topics), `root` is the
258
- root's natural identifier, and each edge carries `target` (the referenced node's
259
- identifier) instead of a graph id. The agent reuses these identifiers directly
260
- as the next command's `<query>` — there is nothing else to pass.
261
-
262
- `agent_next_actions` carries up to 5 contextual next-step hints (e.g. after
263
- `inspect`, the agent sees `jrag callers <fqn>`, `jrag callees <fqn>`, etc. for
264
- the edges the root actually has). Omitted from JSON when empty.
265
-
266
- The full command catalog lives in [Tools & commands at a glance](#tools--commands-at-a-glance).
267
-
268
- ### Flags
269
-
270
- | Flag | Scope | Effect |
271
- |------|-------|--------|
272
- | `--format text\|json` | all | output format (default: text) |
273
- | `--service <name>` | listings/traversals | filter by microservice |
274
- | `--module <name>` | listings/traversals | filter by module |
275
- | `--limit <n>` | listings/traversals | cap results (default 20; `limit+1` fetch detects truncation) |
276
- | `--offset <n>` | `find`, `search` only | paginate (other commands reject it) |
277
- | `--kind symbol\|route\|client\|producer` | `<query>` commands | resolve hint |
278
- | `--java-kind`, `--role`, `--fqn-contains` | `<query>` commands | client-side post-filters |
279
- | `--index-dir <path>` | all | override index directory |
280
-
281
- `--offset` is intentionally NOT a global flag: only `find` and `search` route
282
- through backends that accept it. Every other command rejects it.
283
-
284
- A missing or stale index produces an actionable `status: error` envelope (exit
285
- 2) rather than a traceback:
286
-
287
- ```
288
- error: No index at /path/to/code_graph.lbug. Run: java-codebase-rag init --source-root <root>
289
- ```
290
-
291
- See [`plans/active/PLAN-JRAG-CLI.md`](./plans/active/PLAN-JRAG-CLI.md) for the
292
- full design and per-PR breakdown.
293
-
294
- ---
295
-
296
- ## Further reading
297
-
298
- | Document | What's in it |
299
- |---|---|
300
- | [`docs/paper/paper.pdf`](./docs/paper/paper.pdf) | Architecture report — design rationale, GPS metaphor, three-layer architecture, design principles, future work. |
301
- | [`docs/AGENT-GUIDE.md`](./docs/AGENT-GUIDE.md) | Agent-facing guide. Copy-paste into `QWEN.md` / `CLAUDE.md` / `AGENTS.md`. |
302
- | [`docs/CONFIGURATION.md`](./docs/CONFIGURATION.md) | Environment variables, project YAML, graph ontology, brownfield overrides, ignore patterns. |
303
- | [`docs/JAVA-CODEBASE-RAG-CLI.md`](./docs/JAVA-CODEBASE-RAG-CLI.md) | CLI operator playbook: workflows, exit codes, env alignment. |
304
- | [`docs/EDGE-NAVIGATION.md`](./docs/EDGE-NAVIGATION.md) | MCP-traversable edges, directions, dot-key composition. |
305
- | [`skills/`](./skills/) | `/explore-codebase-cli` (CLI surface) + `/explore-codebase` (legacy MCP surface) skills — operating manuals for hosts with skill discovery (alternative to copy-pasting AGENT-GUIDE). See [`skills/README.md`](./skills/README.md). |
306
- | [`docs/MANUAL-VERIFICATION-CHECKLIST.md`](./docs/MANUAL-VERIFICATION-CHECKLIST.md) | 7-phase agent-driven verification after indexing your project. |
307
- | [`docs/CODEBASE_REQUIREMENTS.md`](./docs/CODEBASE_REQUIREMENTS.md) | Assumptions about your Java repo + per-file edit map for non-conforming codebases. |
308
- | [`docs/PRODUCT-VISION.md`](./docs/PRODUCT-VISION.md) | Long-term product direction. |
309
-
310
- ---
311
-
312
- ## Install from source (contributors)
313
-
314
- ```bash
315
- git clone https://github.com/HumanBean17/java-codebase-rag
316
- cd java-codebase-rag
317
- python3 -m venv .venv
318
- .venv/bin/pip install -e ".[dev]"
319
- ```
320
-
321
- The `cocoindex` package powers lifecycle commands that run the indexer (`init`, `increment`, `reprocess`, `erase`). Search and MCP navigation do not invoke it directly.
322
-
323
- The default embedding model is `sentence-transformers/all-MiniLM-L6-v2` (downloaded on first `init`). Override via the `SBERT_MODEL` env var — see [`docs/CONFIGURATION.md` §1](./docs/CONFIGURATION.md#1-environment-variables).
324
-
325
- ---
326
-
327
- ## Roadmap (graph layer)
328
-
329
- - `get_service_topology` — microservice-level summary aggregating `HTTP_CALLS` / `ASYNC_CALLS`.
330
- - Agentic routing layer (query classifier → vector / graph / both).
331
- - Optional `codegraph_nodes` LanceDB table embedding symbol summaries so the graph itself is vector-searchable.