java-codebase-rag 0.6.3__tar.gz → 0.6.4__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.
- {java_codebase_rag-0.6.3/java_codebase_rag.egg-info → java_codebase_rag-0.6.4}/PKG-INFO +10 -10
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/README.md +9 -9
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/ast_java.py +28 -57
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/build_ast_graph.py +23 -19
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/graph_enrich.py +13 -35
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag/cli.py +10 -10
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag/install_data/agents/explorer-rag-enhanced.md +3 -3
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag/install_data/skills/explore-codebase/SKILL.md +5 -5
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4/java_codebase_rag.egg-info}/PKG-INFO +10 -10
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag.egg-info/SOURCES.txt +1 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_index_flow_lancedb.py +86 -21
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/ladybug_queries.py +45 -51
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/mcp_v2.py +9 -17
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/path_filtering.py +14 -17
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/pr_analysis.py +3 -4
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/pyproject.toml +1 -1
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/search_lancedb.py +2 -2
- java_codebase_rag-0.6.4/tests/test_ast_java_thread_safety.py +66 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_path_filtering.py +14 -14
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/LICENSE +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/brownfield_events.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/chunk_heuristics.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/index_common.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag/__init__.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag/_fdlimit.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag/cli_format.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag/cli_progress.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag/config.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag/installer.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag/lance_optimize.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag/pipeline.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag/progress.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag.egg-info/dependency_links.txt +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag.egg-info/entry_points.txt +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag.egg-info/requires.txt +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_codebase_rag.egg-info/top_level.txt +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_index_v1_common.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/java_ontology.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/mcp_hints.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/server.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/setup.cfg +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_agent_skills_static.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_assign_endpoint_client_extraction.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_ast_graph_build.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_ast_java_calls.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_ast_java_capabilities.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_bank_chat_brownfield_integration.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_brownfield_clients.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_brownfield_events.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_brownfield_overrides.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_brownfield_routes.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_call_edge_matching.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_call_edges_e2e.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_call_graph_receiver_resolution.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_call_graph_smoke_roundtrip.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_call_invariant.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_cli_progress_stdout_invariant.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_cli_quiet_parity.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_client_hint_recovery.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_client_node_extraction.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_client_role_rename.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_config.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_cross_service_resolution_flag.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_edge_navigation_doc.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_fd_limit.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_feign_not_exposer.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_graph_enrich.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_incremental_graph.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_installer.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_installer_integration.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_java_codebase_rag_cli.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_ladybug_queries.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_lance_optimize.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_lancedb_e2e.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_mcp_hints.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_mcp_server_project_root.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_mcp_tools.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_mcp_v2.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_mcp_v2_compose.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_meta_chain_core.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_microservice_scope.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_outgoing_call_extraction.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_packaging_metadata.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_pr_analysis.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_progress.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_resolve_routes_messaging_layer_c.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_route_extraction.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_schema_consistency.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_search_lancedb.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_search_lancedb_capability.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_string_value_atoms.py +0 -0
- {java_codebase_rag-0.6.3 → java_codebase_rag-0.6.4}/tests/test_vectors_progress.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: java-codebase-rag
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.4
|
|
4
4
|
Summary: MCP server for semantic + structural search over Java codebases
|
|
5
5
|
Author: HumanBean17
|
|
6
6
|
License-Expression: MIT
|
|
@@ -44,7 +44,7 @@ Dynamic: license-file
|
|
|
44
44
|
|
|
45
45
|
A graph-native code intelligence layer for Java microservice estates, exposed to LLM agents via the **Model Context Protocol (MCP)**.
|
|
46
46
|
|
|
47
|
-
The system extracts a deterministic property graph from Java source (tree-sitter), stores it in **
|
|
47
|
+
The system extracts a deterministic property graph from Java source (tree-sitter), stores it in **LadybugDB** (graph) alongside a **LanceDB** vector index (chunks), and exposes a deliberately small MCP surface — **five tools**: `search`, `find`, `describe`, `neighbors`, `resolve` — that collapse onto three primitive agent operations: **locate**, **inspect**, **walk**.
|
|
48
48
|
|
|
49
49
|
> **What this MCP is:** a **GPS for code navigation**, not a reasoning engine.
|
|
50
50
|
> Agents use a simple loop:
|
|
@@ -63,9 +63,9 @@ For the design rationale, the GPS metaphor, and the full ontology, see [`docs/pa
|
|
|
63
63
|
|
|
64
64
|
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.
|
|
65
65
|
|
|
66
|
-
- **Hybrid RAG + GraphRAG, not either-or.** Semantic recall (LanceDB chunk vectors) and structural navigation (
|
|
66
|
+
- **Hybrid RAG + GraphRAG, not either-or.** Semantic recall (LanceDB chunk vectors) and structural navigation (LadybugDB property 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.
|
|
67
67
|
|
|
68
|
-
- **A Java-tuned role model.** Symbols are labelled with stereotypes inferred from Spring and JAX-RS conventions — `CONTROLLER`, `SERVICE`, `REPOSITORY`, `
|
|
68
|
+
- **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.
|
|
69
69
|
|
|
70
70
|
- **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.
|
|
71
71
|
|
|
@@ -113,7 +113,7 @@ All indexing lifecycle commands (`init`, `increment`, `reprocess`, `install`, `u
|
|
|
113
113
|
|
|
114
114
|
If you prefer manual configuration, see [`docs/JAVA-CODEBASE-RAG-CLI.md`](./docs/JAVA-CODEBASE-RAG-CLI.md) for the full CLI reference.
|
|
115
115
|
|
|
116
|
-
> **Stability disclaimer.** This package does **not** promise backward compatibility. MCP tool contracts, env vars, Lance/
|
|
116
|
+
> **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.
|
|
117
117
|
|
|
118
118
|
---
|
|
119
119
|
|
|
@@ -126,7 +126,7 @@ This repo ships a small multi-module Spring fixture under [`tests/bank-chat-syst
|
|
|
126
126
|
git clone https://github.com/HumanBean17/java-codebase-rag
|
|
127
127
|
cd java-codebase-rag
|
|
128
128
|
|
|
129
|
-
# 2. Build the index (Lance vectors +
|
|
129
|
+
# 2. Build the index (Lance vectors + LadybugDB graph). First run downloads the
|
|
130
130
|
# embedding model (~90 MB) and takes ~30-60s on the fixture.
|
|
131
131
|
java-codebase-rag init --source-root tests/bank-chat-system --index-dir /tmp/bank-chat-index
|
|
132
132
|
|
|
@@ -141,7 +141,7 @@ Smoke-test the index with two checks (`search_lancedb` ships with the package):
|
|
|
141
141
|
JAVA_CODEBASE_RAG_INDEX_DIR=/tmp/bank-chat-index \
|
|
142
142
|
python -m search_lancedb "chat ingress controller" --table java --limit 3
|
|
143
143
|
|
|
144
|
-
# Vector + graph expansion — proves
|
|
144
|
+
# Vector + graph expansion — proves LadybugDB is wired in
|
|
145
145
|
JAVA_CODEBASE_RAG_INDEX_DIR=/tmp/bank-chat-index \
|
|
146
146
|
python -m search_lancedb "chat ingress controller" --table java --limit 3 \
|
|
147
147
|
--graph-expand --expand-depth 2
|
|
@@ -241,8 +241,8 @@ Run `java-codebase-rag --help` to list grouped subcommands. Operator playbook wi
|
|
|
241
241
|
| Setup | `install` | Interactive setup wizard: config, MCP registration, skill/agent deployment, indexing. |
|
|
242
242
|
| Setup | `update` | Refresh shipped artifacts (skill, agent, MCP entry) + incremental Lance/graph catch-up after pip upgrade. |
|
|
243
243
|
| Lifecycle | `init` | First-time index. Refuses if artifacts already exist. |
|
|
244
|
-
| Lifecycle | `increment` | CocoIndex catch-up + incremental
|
|
245
|
-
| Lifecycle | `reprocess` | Full Lance +
|
|
244
|
+
| Lifecycle | `increment` | CocoIndex catch-up + incremental LadybugDB update. `--vectors-only` for Lance only. |
|
|
245
|
+
| Lifecycle | `reprocess` | Full Lance + LadybugDB rebuild. `--vectors-only` / `--graph-only` for a single phase. |
|
|
246
246
|
| Lifecycle | `erase` | Delete index artifacts. Requires `--yes` or TTY confirm. |
|
|
247
247
|
| Introspection | `meta`, `tables`, `diagnose-ignore`, `unresolved-calls` | Health, table listing, ignore-layer diagnostics, receiver-failure call sites. |
|
|
248
248
|
| Analysis | `analyze-pr` | Blast-radius / risk from a unified diff. |
|
|
@@ -277,7 +277,7 @@ python3 -m venv .venv
|
|
|
277
277
|
|
|
278
278
|
The `cocoindex` package powers lifecycle commands that run the indexer (`init`, `increment`, `reprocess`, `erase`). Search and MCP navigation do not invoke it directly.
|
|
279
279
|
|
|
280
|
-
The default embedding model is `sentence-transformers/all-MiniLM-L6-v2` (downloaded on first `init`). Override via the `
|
|
280
|
+
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).
|
|
281
281
|
|
|
282
282
|
---
|
|
283
283
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A graph-native code intelligence layer for Java microservice estates, exposed to LLM agents via the **Model Context Protocol (MCP)**.
|
|
4
4
|
|
|
5
|
-
The system extracts a deterministic property graph from Java source (tree-sitter), stores it in **
|
|
5
|
+
The system extracts a deterministic property graph from Java source (tree-sitter), stores it in **LadybugDB** (graph) alongside a **LanceDB** vector index (chunks), and exposes a deliberately small MCP surface — **five tools**: `search`, `find`, `describe`, `neighbors`, `resolve` — that collapse onto three primitive agent operations: **locate**, **inspect**, **walk**.
|
|
6
6
|
|
|
7
7
|
> **What this MCP is:** a **GPS for code navigation**, not a reasoning engine.
|
|
8
8
|
> Agents use a simple loop:
|
|
@@ -21,9 +21,9 @@ For the design rationale, the GPS metaphor, and the full ontology, see [`docs/pa
|
|
|
21
21
|
|
|
22
22
|
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.
|
|
23
23
|
|
|
24
|
-
- **Hybrid RAG + GraphRAG, not either-or.** Semantic recall (LanceDB chunk vectors) and structural navigation (
|
|
24
|
+
- **Hybrid RAG + GraphRAG, not either-or.** Semantic recall (LanceDB chunk vectors) and structural navigation (LadybugDB property 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.
|
|
25
25
|
|
|
26
|
-
- **A Java-tuned role model.** Symbols are labelled with stereotypes inferred from Spring and JAX-RS conventions — `CONTROLLER`, `SERVICE`, `REPOSITORY`, `
|
|
26
|
+
- **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.
|
|
27
27
|
|
|
28
28
|
- **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.
|
|
29
29
|
|
|
@@ -71,7 +71,7 @@ All indexing lifecycle commands (`init`, `increment`, `reprocess`, `install`, `u
|
|
|
71
71
|
|
|
72
72
|
If you prefer manual configuration, see [`docs/JAVA-CODEBASE-RAG-CLI.md`](./docs/JAVA-CODEBASE-RAG-CLI.md) for the full CLI reference.
|
|
73
73
|
|
|
74
|
-
> **Stability disclaimer.** This package does **not** promise backward compatibility. MCP tool contracts, env vars, Lance/
|
|
74
|
+
> **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.
|
|
75
75
|
|
|
76
76
|
---
|
|
77
77
|
|
|
@@ -84,7 +84,7 @@ This repo ships a small multi-module Spring fixture under [`tests/bank-chat-syst
|
|
|
84
84
|
git clone https://github.com/HumanBean17/java-codebase-rag
|
|
85
85
|
cd java-codebase-rag
|
|
86
86
|
|
|
87
|
-
# 2. Build the index (Lance vectors +
|
|
87
|
+
# 2. Build the index (Lance vectors + LadybugDB graph). First run downloads the
|
|
88
88
|
# embedding model (~90 MB) and takes ~30-60s on the fixture.
|
|
89
89
|
java-codebase-rag init --source-root tests/bank-chat-system --index-dir /tmp/bank-chat-index
|
|
90
90
|
|
|
@@ -99,7 +99,7 @@ Smoke-test the index with two checks (`search_lancedb` ships with the package):
|
|
|
99
99
|
JAVA_CODEBASE_RAG_INDEX_DIR=/tmp/bank-chat-index \
|
|
100
100
|
python -m search_lancedb "chat ingress controller" --table java --limit 3
|
|
101
101
|
|
|
102
|
-
# Vector + graph expansion — proves
|
|
102
|
+
# Vector + graph expansion — proves LadybugDB is wired in
|
|
103
103
|
JAVA_CODEBASE_RAG_INDEX_DIR=/tmp/bank-chat-index \
|
|
104
104
|
python -m search_lancedb "chat ingress controller" --table java --limit 3 \
|
|
105
105
|
--graph-expand --expand-depth 2
|
|
@@ -199,8 +199,8 @@ Run `java-codebase-rag --help` to list grouped subcommands. Operator playbook wi
|
|
|
199
199
|
| Setup | `install` | Interactive setup wizard: config, MCP registration, skill/agent deployment, indexing. |
|
|
200
200
|
| Setup | `update` | Refresh shipped artifacts (skill, agent, MCP entry) + incremental Lance/graph catch-up after pip upgrade. |
|
|
201
201
|
| Lifecycle | `init` | First-time index. Refuses if artifacts already exist. |
|
|
202
|
-
| Lifecycle | `increment` | CocoIndex catch-up + incremental
|
|
203
|
-
| Lifecycle | `reprocess` | Full Lance +
|
|
202
|
+
| Lifecycle | `increment` | CocoIndex catch-up + incremental LadybugDB update. `--vectors-only` for Lance only. |
|
|
203
|
+
| Lifecycle | `reprocess` | Full Lance + LadybugDB rebuild. `--vectors-only` / `--graph-only` for a single phase. |
|
|
204
204
|
| Lifecycle | `erase` | Delete index artifacts. Requires `--yes` or TTY confirm. |
|
|
205
205
|
| Introspection | `meta`, `tables`, `diagnose-ignore`, `unresolved-calls` | Health, table listing, ignore-layer diagnostics, receiver-failure call sites. |
|
|
206
206
|
| Analysis | `analyze-pr` | Blast-radius / risk from a unified diff. |
|
|
@@ -235,7 +235,7 @@ python3 -m venv .venv
|
|
|
235
235
|
|
|
236
236
|
The `cocoindex` package powers lifecycle commands that run the indexer (`init`, `increment`, `reprocess`, `erase`). Search and MCP navigation do not invoke it directly.
|
|
237
237
|
|
|
238
|
-
The default embedding model is `sentence-transformers/all-MiniLM-L6-v2` (downloaded on first `init`). Override via the `
|
|
238
|
+
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).
|
|
239
239
|
|
|
240
240
|
---
|
|
241
241
|
|
|
@@ -14,8 +14,8 @@ from __future__ import annotations
|
|
|
14
14
|
|
|
15
15
|
import posixpath
|
|
16
16
|
import sys
|
|
17
|
+
import threading
|
|
17
18
|
from dataclasses import dataclass, field
|
|
18
|
-
from functools import lru_cache
|
|
19
19
|
from typing import Iterable
|
|
20
20
|
|
|
21
21
|
import tree_sitter_java as _ts_java
|
|
@@ -215,10 +215,23 @@ _ANON_SUPER_AS_INTERFACE: frozenset[str] = frozenset({
|
|
|
215
215
|
})
|
|
216
216
|
|
|
217
217
|
|
|
218
|
-
|
|
218
|
+
# tree-sitter's ``Parser`` mutates internal state during ``parse()`` and is NOT
|
|
219
|
+
# thread-safe, so each OS thread gets its own instance. ``parse_java`` is called
|
|
220
|
+
# concurrently from worker threads when indexing runs with cocoindex's inflight
|
|
221
|
+
# parallelism — both directly (java_index_flow_lancedb.py: process_java_file
|
|
222
|
+
# offloads parse+enrich to asyncio.to_thread) and transitively
|
|
223
|
+
# (graph_enrich.collect_annotation_meta_chain -> _collect_annotation_decl_index
|
|
224
|
+
# -> parse_java, reached from enrich_chunk). The ``Language`` is immutable and
|
|
225
|
+
# shared; per-thread ``Parser`` construction is lazy and cheap (once per thread),
|
|
226
|
+
# which also preserves parse parallelism instead of serializing it.
|
|
227
|
+
_parser_tls = threading.local()
|
|
228
|
+
|
|
229
|
+
|
|
219
230
|
def _parser() -> Parser:
|
|
220
|
-
|
|
221
|
-
|
|
231
|
+
p = getattr(_parser_tls, "parser", None)
|
|
232
|
+
if p is None:
|
|
233
|
+
_parser_tls.parser = p = Parser(Language(_ts_java.language()))
|
|
234
|
+
return p
|
|
222
235
|
|
|
223
236
|
|
|
224
237
|
# ---------- dataclasses ----------
|
|
@@ -1565,62 +1578,20 @@ def _parse_codebase_http_route_inner_annotation(
|
|
|
1565
1578
|
return out
|
|
1566
1579
|
|
|
1567
1580
|
|
|
1568
|
-
def
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
def visit(n: Node) -> None:
|
|
1572
|
-
if n.type == "annotation":
|
|
1573
|
-
name_node = n.child_by_field_name("name")
|
|
1574
|
-
n_simple = _txt(name_node, src).rsplit(".", 1)[-1] if name_node is not None else ""
|
|
1575
|
-
if n_simple == "CodebaseHttpRoute":
|
|
1576
|
-
found.append(n)
|
|
1577
|
-
for c in n.children:
|
|
1578
|
-
visit(c)
|
|
1581
|
+
def _inner_annotation_nodes(container_ann: Node, src: bytes, target_simple: str) -> list[Node]:
|
|
1582
|
+
"""Collect nested ``@<target_simple>`` annotations anywhere under ``container_ann``.
|
|
1579
1583
|
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
def _codebase_async_route_inner_annotation_nodes(container_ann: Node, src: bytes) -> list[Node]:
|
|
1585
|
-
found: list[Node] = []
|
|
1586
|
-
|
|
1587
|
-
def visit(n: Node) -> None:
|
|
1588
|
-
if n.type == "annotation":
|
|
1589
|
-
name_node = n.child_by_field_name("name")
|
|
1590
|
-
n_simple = _txt(name_node, src).rsplit(".", 1)[-1] if name_node is not None else ""
|
|
1591
|
-
if n_simple == "CodebaseAsyncRoute":
|
|
1592
|
-
found.append(n)
|
|
1593
|
-
for c in n.children:
|
|
1594
|
-
visit(c)
|
|
1595
|
-
|
|
1596
|
-
visit(container_ann)
|
|
1597
|
-
return found
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
def _codebase_http_client_inner_annotation_nodes(container_ann: Node, src: bytes) -> list[Node]:
|
|
1601
|
-
found: list[Node] = []
|
|
1602
|
-
|
|
1603
|
-
def visit(n: Node) -> None:
|
|
1604
|
-
if n.type == "annotation":
|
|
1605
|
-
name_node = n.child_by_field_name("name")
|
|
1606
|
-
n_simple = _txt(name_node, src).rsplit(".", 1)[-1] if name_node is not None else ""
|
|
1607
|
-
if n_simple == "CodebaseHttpClient":
|
|
1608
|
-
found.append(n)
|
|
1609
|
-
for c in n.children:
|
|
1610
|
-
visit(c)
|
|
1611
|
-
|
|
1612
|
-
visit(container_ann)
|
|
1613
|
-
return found
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
def _codebase_producer_inner_annotation_nodes(container_ann: Node, src: bytes) -> list[Node]:
|
|
1584
|
+
Shared by the four brownfield container walkers — ``CodebaseHttpRoute``,
|
|
1585
|
+
``CodebaseAsyncRoute``, ``CodebaseHttpClient``, ``CodebaseProducer`` — which
|
|
1586
|
+
differ only by the target annotation simple name.
|
|
1587
|
+
"""
|
|
1617
1588
|
found: list[Node] = []
|
|
1618
1589
|
|
|
1619
1590
|
def visit(n: Node) -> None:
|
|
1620
1591
|
if n.type == "annotation":
|
|
1621
1592
|
name_node = n.child_by_field_name("name")
|
|
1622
1593
|
n_simple = _txt(name_node, src).rsplit(".", 1)[-1] if name_node is not None else ""
|
|
1623
|
-
if n_simple ==
|
|
1594
|
+
if n_simple == target_simple:
|
|
1624
1595
|
found.append(n)
|
|
1625
1596
|
for c in n.children:
|
|
1626
1597
|
visit(c)
|
|
@@ -1842,7 +1813,7 @@ def _outgoing_calls_from_codebase_http_client_producer_annotations(
|
|
|
1842
1813
|
),
|
|
1843
1814
|
)
|
|
1844
1815
|
elif simple == "CodebaseHttpClients":
|
|
1845
|
-
for inner in
|
|
1816
|
+
for inner in _inner_annotation_nodes(ann, src, "CodebaseHttpClient"):
|
|
1846
1817
|
out.append(
|
|
1847
1818
|
_parse_codebase_http_client_annotation(
|
|
1848
1819
|
inner,
|
|
@@ -1869,7 +1840,7 @@ def _outgoing_calls_from_codebase_http_client_producer_annotations(
|
|
|
1869
1840
|
),
|
|
1870
1841
|
)
|
|
1871
1842
|
elif simple == "CodebaseProducers":
|
|
1872
|
-
for inner in
|
|
1843
|
+
for inner in _inner_annotation_nodes(ann, src, "CodebaseProducer"):
|
|
1873
1844
|
out.append(
|
|
1874
1845
|
_parse_codebase_producer_annotation(
|
|
1875
1846
|
inner,
|
|
@@ -2343,7 +2314,7 @@ def _collect_routes(
|
|
|
2343
2314
|
),
|
|
2344
2315
|
)
|
|
2345
2316
|
elif simple == "CodebaseHttpRoutes":
|
|
2346
|
-
for inner in
|
|
2317
|
+
for inner in _inner_annotation_nodes(node, src, "CodebaseHttpRoute"):
|
|
2347
2318
|
routes.extend(
|
|
2348
2319
|
_parse_codebase_http_route_inner_annotation(
|
|
2349
2320
|
inner,
|
|
@@ -2359,7 +2330,7 @@ def _collect_routes(
|
|
|
2359
2330
|
elif simple in ("CodebaseAsyncRoute", "CodebaseAsyncRoutes"):
|
|
2360
2331
|
nodes = [node]
|
|
2361
2332
|
if simple == "CodebaseAsyncRoutes":
|
|
2362
|
-
nodes = list(
|
|
2333
|
+
nodes = list(_inner_annotation_nodes(node, src, "CodebaseAsyncRoute"))
|
|
2363
2334
|
for ann in nodes:
|
|
2364
2335
|
pairs, _ = _annotation_kv_nodes(ann, src)
|
|
2365
2336
|
topic_node = pairs.get("topic")
|
|
@@ -2010,8 +2010,21 @@ def _producer_id(
|
|
|
2010
2010
|
return f"p:{hashlib.sha1(key.encode()).hexdigest()[:16]}"
|
|
2011
2011
|
|
|
2012
2012
|
|
|
2013
|
+
# The four brownfield source layers — single source of truth. Consumed by the
|
|
2014
|
+
# client/producer source-layer classifiers, the *_from_brownfield_pct stats
|
|
2015
|
+
# (via brownfield_strategies), and the brownfield_only authoritativeness gate in
|
|
2016
|
+
# _is_brownfield_sourced. codebase_client/codebase_producer are caller-side
|
|
2017
|
+
# declaration strategies, not layers — they extend brownfield_strategies only.
|
|
2018
|
+
_BROWNFIELD_LAYERS = frozenset({
|
|
2019
|
+
"layer_a_meta",
|
|
2020
|
+
"layer_b_ann",
|
|
2021
|
+
"layer_b_fqn",
|
|
2022
|
+
"layer_c_source",
|
|
2023
|
+
})
|
|
2024
|
+
|
|
2025
|
+
|
|
2013
2026
|
def _client_source_layer(strategy: str) -> str:
|
|
2014
|
-
if strategy in
|
|
2027
|
+
if strategy in _BROWNFIELD_LAYERS:
|
|
2015
2028
|
return strategy
|
|
2016
2029
|
# Some caller extraction paths emit client kind as strategy; treat those
|
|
2017
2030
|
# as builtin-source declarations instead of warning on every row.
|
|
@@ -2023,7 +2036,7 @@ def _client_source_layer(strategy: str) -> str:
|
|
|
2023
2036
|
|
|
2024
2037
|
|
|
2025
2038
|
def _producer_source_layer(strategy: str) -> str:
|
|
2026
|
-
if strategy in
|
|
2039
|
+
if strategy in _BROWNFIELD_LAYERS:
|
|
2027
2040
|
return strategy
|
|
2028
2041
|
if strategy in VALID_PRODUCER_KINDS:
|
|
2029
2042
|
return "builtin"
|
|
@@ -2458,15 +2471,14 @@ def pass5_imperative_edges(
|
|
|
2458
2471
|
tables.producer_stats.producers_by_kind = defaultdict(int)
|
|
2459
2472
|
for row in tables.producer_rows:
|
|
2460
2473
|
tables.producer_stats.producers_by_kind[row.producer_kind] += 1
|
|
2461
|
-
brownfield_strategies =
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
),
|
|
2474
|
+
# brownfield_strategies = the four brownfield layers plus the two
|
|
2475
|
+
# caller-side declaration strategies (@CodebaseHttpClient /
|
|
2476
|
+
# @CodebaseProducer). These extend _BROWNFIELD_LAYERS deliberately:
|
|
2477
|
+
# the *_from_brownfield_pct stats count annotation-declared callers as
|
|
2478
|
+
# brownfield-sourced even though they are not "layers" and so do not
|
|
2479
|
+
# gate brownfield_only authoritativeness in _is_brownfield_sourced.
|
|
2480
|
+
brownfield_strategies = _BROWNFIELD_LAYERS | frozenset(
|
|
2481
|
+
{"codebase_client", "codebase_producer"},
|
|
2470
2482
|
)
|
|
2471
2483
|
if tables.call_edge_stats.http_calls_total:
|
|
2472
2484
|
n_http = sum(
|
|
@@ -2568,14 +2580,6 @@ def _match_call_edge(
|
|
|
2568
2580
|
return "cross_service", candidates
|
|
2569
2581
|
|
|
2570
2582
|
|
|
2571
|
-
_BROWNFIELD_LAYERS = frozenset({
|
|
2572
|
-
"layer_c_source",
|
|
2573
|
-
"layer_b_ann",
|
|
2574
|
-
"layer_b_fqn",
|
|
2575
|
-
"layer_a_meta",
|
|
2576
|
-
})
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
2583
|
def _is_brownfield_sourced(
|
|
2580
2584
|
call_strategy: str,
|
|
2581
2585
|
candidates: list[RouteRow],
|
|
@@ -23,7 +23,7 @@ import sys
|
|
|
23
23
|
from dataclasses import dataclass, field, replace
|
|
24
24
|
from functools import lru_cache
|
|
25
25
|
from pathlib import Path
|
|
26
|
-
from typing import Any
|
|
26
|
+
from typing import Any, TypeVar
|
|
27
27
|
from ast_java import (
|
|
28
28
|
AnnotationRef,
|
|
29
29
|
JavaFileAst,
|
|
@@ -820,7 +820,15 @@ def _route_path_atom(raw_value: str, value_kind: str | None) -> tuple[str, str,
|
|
|
820
820
|
return "", "constant_ref", 0.7, False
|
|
821
821
|
|
|
822
822
|
|
|
823
|
-
|
|
823
|
+
_HINT = TypeVar("_HINT")
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
def _hint_lookup(ann: AnnotationRef, hints: dict[str, _HINT]) -> _HINT | None:
|
|
827
|
+
"""Resolve a brownfield hint by qualified name, then simple name, then suffix.
|
|
828
|
+
|
|
829
|
+
Shared by route / http-client / async-producer hint resolution; the three
|
|
830
|
+
former copies differed only in the hint value type.
|
|
831
|
+
"""
|
|
824
832
|
q = ann.qualified.strip()
|
|
825
833
|
if q in hints:
|
|
826
834
|
return hints[q]
|
|
@@ -1118,7 +1126,7 @@ def resolve_routes_for_method(
|
|
|
1118
1126
|
|
|
1119
1127
|
# ----- Step 2: Layer B — annotation route hints -----
|
|
1120
1128
|
for _is_m, ann in combined_anns:
|
|
1121
|
-
hint =
|
|
1129
|
+
hint = _hint_lookup(ann, overrides.annotation_to_route_hint)
|
|
1122
1130
|
if hint is None:
|
|
1123
1131
|
continue
|
|
1124
1132
|
working.append(
|
|
@@ -1172,36 +1180,6 @@ def resolve_routes_for_method(
|
|
|
1172
1180
|
return working
|
|
1173
1181
|
|
|
1174
1182
|
|
|
1175
|
-
def _client_hint_lookup(
|
|
1176
|
-
ann: AnnotationRef,
|
|
1177
|
-
hints: dict[str, HttpClientHint],
|
|
1178
|
-
) -> HttpClientHint | None:
|
|
1179
|
-
q = ann.qualified.strip()
|
|
1180
|
-
if q in hints:
|
|
1181
|
-
return hints[q]
|
|
1182
|
-
if ann.name in hints:
|
|
1183
|
-
return hints[ann.name]
|
|
1184
|
-
for k, h in sorted(hints.items(), key=lambda kv: kv[0]):
|
|
1185
|
-
if k.endswith("." + ann.name):
|
|
1186
|
-
return h
|
|
1187
|
-
return None
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
def _async_hint_lookup(
|
|
1191
|
-
ann: AnnotationRef,
|
|
1192
|
-
hints: dict[str, AsyncProducerHint],
|
|
1193
|
-
) -> AsyncProducerHint | None:
|
|
1194
|
-
q = ann.qualified.strip()
|
|
1195
|
-
if q in hints:
|
|
1196
|
-
return hints[q]
|
|
1197
|
-
if ann.name in hints:
|
|
1198
|
-
return hints[ann.name]
|
|
1199
|
-
for k, h in sorted(hints.items(), key=lambda kv: kv[0]):
|
|
1200
|
-
if k.endswith("." + ann.name):
|
|
1201
|
-
return h
|
|
1202
|
-
return None
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
1183
|
def _call_from_http_hint(
|
|
1206
1184
|
*,
|
|
1207
1185
|
hint: HttpClientHint,
|
|
@@ -1296,7 +1274,7 @@ def resolve_http_client_for_method(
|
|
|
1296
1274
|
anchor = builtin_http[0] if builtin_http else (layer_c_src[0] if layer_c_src else None)
|
|
1297
1275
|
|
|
1298
1276
|
for _is_m, ann in combined_anns:
|
|
1299
|
-
hint =
|
|
1277
|
+
hint = _hint_lookup(ann, overrides.annotation_to_http_client_hint)
|
|
1300
1278
|
if hint is None:
|
|
1301
1279
|
continue
|
|
1302
1280
|
brownfield_calls.append(
|
|
@@ -1388,7 +1366,7 @@ def resolve_async_producer_for_method(
|
|
|
1388
1366
|
anchor = builtin_async[0] if builtin_async else (layer_c_src[0] if layer_c_src else None)
|
|
1389
1367
|
|
|
1390
1368
|
for _is_m, ann in combined_anns:
|
|
1391
|
-
hint =
|
|
1369
|
+
hint = _hint_lookup(ann, overrides.annotation_to_async_producer_hint)
|
|
1392
1370
|
if hint is None:
|
|
1393
1371
|
continue
|
|
1394
1372
|
brownfield_calls.append(
|
|
@@ -251,7 +251,7 @@ def _startup_hints(cfg: ResolvedOperatorConfig) -> None:
|
|
|
251
251
|
|
|
252
252
|
def _add_index_embedding_flags(p: argparse.ArgumentParser) -> None:
|
|
253
253
|
p.add_argument("--source-root", type=str, default=None, help="Java repository root (default: cwd)")
|
|
254
|
-
p.add_argument("--index-dir", type=str, default=None, help="Index directory (Lance +
|
|
254
|
+
p.add_argument("--index-dir", type=str, default=None, help="Index directory (Lance + LadybugDB + cocoindex state)")
|
|
255
255
|
p.add_argument("--embedding-model", type=str, default=None, help="Override SBERT_MODEL / YAML embedding.model")
|
|
256
256
|
p.add_argument("--embedding-device", type=str, default=None, help="Override SBERT_DEVICE / YAML embedding.device")
|
|
257
257
|
|
|
@@ -536,7 +536,7 @@ def _cmd_reprocess(args: argparse.Namespace) -> int:
|
|
|
536
536
|
_emit_reprocess_outcome(payload, selective_tty_mode="graph" if ok else None)
|
|
537
537
|
return _reprocess_exit_code(payload)
|
|
538
538
|
|
|
539
|
-
import server # lazy: pulls sentence_transformers/torch/lancedb/
|
|
539
|
+
import server # lazy: pulls sentence_transformers/torch/lancedb/ladybug
|
|
540
540
|
|
|
541
541
|
result = asyncio.run(
|
|
542
542
|
server.run_refresh_pipeline(
|
|
@@ -715,7 +715,7 @@ def _cmd_unresolved_calls_list(args: argparse.Namespace) -> int:
|
|
|
715
715
|
from ladybug_queries import LadybugGraph # lazy
|
|
716
716
|
|
|
717
717
|
if not LadybugGraph.exists():
|
|
718
|
-
_emit({"success": False, "message": "
|
|
718
|
+
_emit({"success": False, "message": "LadybugDB graph not found"})
|
|
719
719
|
return 1
|
|
720
720
|
graph = LadybugGraph.get()
|
|
721
721
|
rows = graph.list_unresolved_call_sites(
|
|
@@ -736,7 +736,7 @@ def _cmd_unresolved_calls_stats(args: argparse.Namespace) -> int:
|
|
|
736
736
|
from ladybug_queries import LadybugGraph # lazy
|
|
737
737
|
|
|
738
738
|
if not LadybugGraph.exists():
|
|
739
|
-
_emit({"success": False, "message": "
|
|
739
|
+
_emit({"success": False, "message": "LadybugDB graph not found"})
|
|
740
740
|
return 1
|
|
741
741
|
graph = LadybugGraph.get()
|
|
742
742
|
buckets = graph.stats_unresolved_call_sites(by=args.by)
|
|
@@ -761,7 +761,7 @@ def _cmd_analyze_pr(args: argparse.Namespace) -> int:
|
|
|
761
761
|
from ladybug_queries import LadybugGraph # lazy
|
|
762
762
|
|
|
763
763
|
if not LadybugGraph.exists():
|
|
764
|
-
_emit({"success": False, "message": "
|
|
764
|
+
_emit({"success": False, "message": "LadybugDB graph not found"})
|
|
765
765
|
return 1
|
|
766
766
|
graph = LadybugGraph.get()
|
|
767
767
|
report = pr_analysis.analyze_pr_pipeline(graph, diff_text)
|
|
@@ -801,7 +801,7 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
801
801
|
help="Create a fresh index from a Java repository.",
|
|
802
802
|
description=(
|
|
803
803
|
"First-time index creation. Refuses if the resolved index directory "
|
|
804
|
-
"already contains a
|
|
804
|
+
"already contains a LadybugDB graph or Lance tables. Exit 2 on refusal."
|
|
805
805
|
),
|
|
806
806
|
)
|
|
807
807
|
_add_index_embedding_flags(init)
|
|
@@ -870,7 +870,7 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
870
870
|
increment = subparsers.add_parser(
|
|
871
871
|
"increment",
|
|
872
872
|
help="Pick up changes since the last index update.",
|
|
873
|
-
description="Runs cocoindex catch-up and incremental
|
|
873
|
+
description="Runs cocoindex catch-up and incremental LadybugDB graph update. Use --vectors-only to skip graph update.",
|
|
874
874
|
)
|
|
875
875
|
_add_index_embedding_flags(increment)
|
|
876
876
|
_add_verbosity_flags(increment)
|
|
@@ -883,9 +883,9 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
883
883
|
|
|
884
884
|
reprocess = subparsers.add_parser(
|
|
885
885
|
"reprocess",
|
|
886
|
-
help="Rebuild vectors and/or
|
|
886
|
+
help="Rebuild vectors and/or LadybugDB (default: both full phases).",
|
|
887
887
|
description=(
|
|
888
|
-
"Default: full Lance reprocess (cocoindex --full-reprocess) then full
|
|
888
|
+
"Default: full Lance reprocess (cocoindex --full-reprocess) then full LadybugDB graph rebuild. "
|
|
889
889
|
"Use --vectors-only or --graph-only to run a single phase (mutually exclusive)."
|
|
890
890
|
),
|
|
891
891
|
)
|
|
@@ -907,7 +907,7 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
907
907
|
erase = subparsers.add_parser(
|
|
908
908
|
"erase",
|
|
909
909
|
help="Delete the index from disk.",
|
|
910
|
-
description="Runs cocoindex drop, removes
|
|
910
|
+
description="Runs cocoindex drop, removes LadybugDB, and drops Lance tables. Requires --yes or TTY confirmation.",
|
|
911
911
|
)
|
|
912
912
|
_add_index_embedding_flags(erase)
|
|
913
913
|
erase.add_argument("--yes", action="store_true", help="Confirm destructive deletion (required in CI)")
|
|
@@ -151,15 +151,15 @@ Simple types in parentheses; generics erased. No spaces after commas. No-arg: `(
|
|
|
151
151
|
|
|
152
152
|
### Shared NodeFilter
|
|
153
153
|
|
|
154
|
-
For `find`, `filter` is required — `{}` means no predicates. **Strict frame:** unknown keys or inapplicable populated fields → `success=false
|
|
154
|
+
For `find`, `filter` is required — `{}` means no predicates. **Strict frame:** unknown keys or inapplicable populated fields → `success=false`; invalid enum values (e.g. wrong case) are rejected earlier at the schema layer with the valid set listed.
|
|
155
155
|
|
|
156
156
|
| Keys | Applies to |
|
|
157
157
|
| ---- | ---------- |
|
|
158
158
|
| `microservice`, `module` | All kinds |
|
|
159
159
|
| `role`, `exclude_roles`, `annotation`, `capability`, `fqn_prefix`, `symbol_kind`, `symbol_kinds` | **symbol** |
|
|
160
160
|
| `http_method`, `path_prefix`, `framework` | **route** |
|
|
161
|
-
| `client_kind`, `target_service`, `target_path_prefix`, `http_method` | **client** |
|
|
162
|
-
| `producer_kind`, `topic_prefix` | **producer** |
|
|
161
|
+
| `source_layer`, `client_kind`, `target_service`, `target_path_prefix`, `http_method` | **client** |
|
|
162
|
+
| `source_layer`, `producer_kind`, `topic_prefix` | **producer** |
|
|
163
163
|
|
|
164
164
|
No wildcards in prefix fields — use `search(query=…)` for fuzzy text.
|
|
165
165
|
|
|
@@ -125,15 +125,15 @@ Use these strings **verbatim** in `neighbors(..., edge_types=[...])`.
|
|
|
125
125
|
|
|
126
126
|
### NodeFilter (`find`, `search.filter`, `neighbors.filter`)
|
|
127
127
|
|
|
128
|
-
For `find`, `filter` is required — `{}` means no predicates. **Strict frame:** unknown keys or inapplicable populated fields → `success=false
|
|
128
|
+
For `find`, `filter` is required — `{}` means no predicates. **Strict frame:** unknown keys or inapplicable populated fields → `success=false`; invalid enum values (e.g. wrong case) are rejected earlier at the schema layer with the valid set listed.
|
|
129
129
|
|
|
130
130
|
| Applicable to | Keys |
|
|
131
131
|
| ------------- | ---- |
|
|
132
132
|
| All kinds | `microservice`, `module` |
|
|
133
133
|
| **symbol** only | `role`, `exclude_roles`, `annotation`, `capability`, `fqn_prefix`, `symbol_kind`, `symbol_kinds` |
|
|
134
134
|
| **route** only | `http_method`, `path_prefix`, `framework` |
|
|
135
|
-
| **client** only | `client_kind`, `target_service`, `target_path_prefix`, `http_method` |
|
|
136
|
-
| **producer** only | `producer_kind`, `topic_prefix` |
|
|
135
|
+
| **client** only | `source_layer`, `client_kind`, `target_service`, `target_path_prefix`, `http_method` |
|
|
136
|
+
| **producer** only | `source_layer`, `producer_kind`, `topic_prefix` |
|
|
137
137
|
|
|
138
138
|
No wildcards in prefix fields — use `search(query=…)` for ranked text.
|
|
139
139
|
|
|
@@ -166,8 +166,8 @@ Exclude `DTO`, `OTHER`, `MAPPER` with `exclude_roles` when tracing business logi
|
|
|
166
166
|
|
|
167
167
|
**Symbol kinds:** `class`, `interface`, `enum`, `record`, `annotation`, `method`, `constructor`.
|
|
168
168
|
|
|
169
|
-
**Route frameworks:** `spring_mvc`, `webflux
|
|
170
|
-
**Client kinds:** `feign_method`, `rest_template`, `web_client`. **Producer kinds:** `kafka_send`, `stream_bridge_send`.
|
|
169
|
+
**Route frameworks:** `spring_mvc`, `webflux`. (Route *kinds* are `http_endpoint`, `http_consumer`, `kafka_topic`, `rabbit_queue`, `jms_destination`, `stream_binding`.)
|
|
170
|
+
**Client kinds:** `feign_method`, `rest_template`, `web_client`. **Producer kinds:** `kafka_send`, `stream_bridge_send`. **Source layers (client/producer):** `builtin`, `layer_a_meta`, `layer_b_ann`, `layer_b_fqn`, `layer_c_source`.
|
|
171
171
|
**Match types:** `cross_service`, `intra_service`, `ambiguous`, `phantom`, `unresolved`.
|
|
172
172
|
|
|
173
173
|
---
|