java-codebase-rag 0.9.7__py3-none-any.whl → 0.10.0__py3-none-any.whl

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 (34) hide show
  1. java_codebase_rag/analysis/pr_analysis.py +33 -3
  2. java_codebase_rag/ast/ast_java.py +2 -1
  3. java_codebase_rag/cli.py +23 -8
  4. java_codebase_rag/config.py +68 -1
  5. java_codebase_rag/graph/build_ast_graph.py +123 -4
  6. java_codebase_rag/graph/graph_types.py +109 -22
  7. java_codebase_rag/graph/ladybug_queries.py +45 -2
  8. java_codebase_rag/index/java_index_flow_lancedb.py +10 -16
  9. java_codebase_rag/install_data/agents/explorer-rag-cli.md +3 -1
  10. java_codebase_rag/install_data/skills/explore-codebase-cli/SKILL.md +3 -1
  11. java_codebase_rag/jrag.py +627 -661
  12. java_codebase_rag/jrag_render.py +160 -3
  13. java_codebase_rag/lance_optimize.py +11 -12
  14. java_codebase_rag/mcp/mcp_v2.py +2 -1
  15. java_codebase_rag/pipeline.py +47 -1
  16. java_codebase_rag/read_payloads.py +781 -0
  17. java_codebase_rag/search/search_lancedb.py +138 -6
  18. java_codebase_rag/search/search_lexical.py +128 -30
  19. java_codebase_rag/search/search_scoring.py +82 -0
  20. java_codebase_rag/watch/__init__.py +0 -0
  21. java_codebase_rag/watch/client.py +230 -0
  22. java_codebase_rag/watch/daemon.py +368 -0
  23. java_codebase_rag/watch/lock.py +201 -0
  24. java_codebase_rag/watch/paths.py +76 -0
  25. java_codebase_rag/watch/protocol.py +122 -0
  26. java_codebase_rag/watch/server.py +273 -0
  27. java_codebase_rag/watch/warm.py +105 -0
  28. java_codebase_rag/watch/watcher.py +352 -0
  29. {java_codebase_rag-0.9.7.dist-info → java_codebase_rag-0.10.0.dist-info}/METADATA +30 -31
  30. {java_codebase_rag-0.9.7.dist-info → java_codebase_rag-0.10.0.dist-info}/RECORD +34 -24
  31. {java_codebase_rag-0.9.7.dist-info → java_codebase_rag-0.10.0.dist-info}/WHEEL +0 -0
  32. {java_codebase_rag-0.9.7.dist-info → java_codebase_rag-0.10.0.dist-info}/entry_points.txt +0 -0
  33. {java_codebase_rag-0.9.7.dist-info → java_codebase_rag-0.10.0.dist-info}/licenses/LICENSE +0 -0
  34. {java_codebase_rag-0.9.7.dist-info → java_codebase_rag-0.10.0.dist-info}/top_level.txt +0 -0
@@ -84,19 +84,16 @@ else:
84
84
 
85
85
  splitter = RecursiveSplitter()
86
86
 
87
- # cocoindex 1.0.7 schedules ``table.optimize()`` (a LanceDB Rewrite/compaction
88
- # transaction) as a *background* asyncio task after every
89
- # ``num_transactions_before_optimize`` mutation batches (default 50). That
90
- # background Rewrite races the concurrent ``table.delete()`` (Delete)
91
- # transactions emitted by later batches, and LanceDB does not allow a Rewrite
92
- # to commit concurrently with a Delete (upstream lancedb#1504), which floods
93
- # stderr with "Retryable commit conflict ... preempted by concurrent
94
- # transaction Delete". Setting this effectively to infinity disables the
95
- # in-flight background optimize; the serialized post-flow optimize in
96
- # ``lance_optimize.optimize_lance_tables`` then compacts the table with no
97
- # concurrent writers. ``optimize()`` is pure maintenance (compact/prune/index);
98
- # upsert/delete correctness via merge_insert does not depend on it.
99
- _NUM_TXN_BEFORE_OPTIMIZE = 10**12
87
+ # LanceDB table optimization: cocoindex >=1.0.15 runs ``table.optimize()``
88
+ # INLINE during merge_insert commits, gated by stats (only when small fragments
89
+ # accumulate — see _RowHandler._maybe_optimize / _evaluate_optimize). That
90
+ # replaces the old 1.0.7 *background* asyncio optimize that raced concurrent
91
+ # Deletes (lancedb#1504 commit conflicts) and which we used to disable via
92
+ # ``num_transactions_before_optimize`` (kwarg removed in 1.0.16). Being inline,
93
+ # it no longer races anything. ``lance_optimize.optimize_lance_tables`` still
94
+ # runs a final serialized compaction post-flow. ``optimize()`` is pure
95
+ # maintenance (compact/prune/index); upsert/delete correctness via merge_insert
96
+ # does not depend on it.
100
97
 
101
98
 
102
99
  # --- Vectors-phase progress emission (JCIRAG_PROGRESS kind=vectors) -----------
@@ -618,7 +615,6 @@ async def app_main() -> None:
618
615
  LANCE_DB,
619
616
  LANCE_TABLE_NAMES[0],
620
617
  java_schema,
621
- num_transactions_before_optimize=_NUM_TXN_BEFORE_OPTIMIZE,
622
618
  )
623
619
 
624
620
  sql_schema = await lancedb.TableSchema.from_class(
@@ -629,7 +625,6 @@ async def app_main() -> None:
629
625
  LANCE_DB,
630
626
  LANCE_TABLE_NAMES[1],
631
627
  sql_schema,
632
- num_transactions_before_optimize=_NUM_TXN_BEFORE_OPTIMIZE,
633
628
  )
634
629
 
635
630
  yaml_schema = await lancedb.TableSchema.from_class(
@@ -640,7 +635,6 @@ async def app_main() -> None:
640
635
  LANCE_DB,
641
636
  LANCE_TABLE_NAMES[2],
642
637
  yaml_schema,
643
- num_transactions_before_optimize=_NUM_TXN_BEFORE_OPTIMIZE,
644
638
  )
645
639
 
646
640
  project_root = coco.use_context(PROJECT_ROOT)
@@ -95,9 +95,11 @@ The Decision Framework above tells you *which* command; reach for `--help` only
95
95
 
96
96
  **Prerequisite.** `jrag` needs an index — unindexed, every command exits 2 (`jrag status` checks; the file-system tools work without one).
97
97
 
98
+ **Tip.** Run `jrag watch` once per session for fast, fresh queries — it keeps the index fresh on file change and serves every read command warm (no per-call model load). Optional; with no daemon running, all reads take the cold path byte-identically.
99
+
98
100
  **Resolve-first contract.** Every `<query>` command resolves the identifier first, then maps `one` / `many` / `none` onto one envelope: `one` → run; `many` → return candidates and stop, **no silent guess across distinct types** (a class sharing its simple name with its own constructor still resolves to the type — narrow with `--kind` / `--role` / `--fqn-contains` / `--service`); `none` → `status: not_found` (exit 0), fall back to `search` or `Grep`. Pass names (FQN / simple name / route path / topic) or prior `sym:`/`route:`/`client:`/`producer:` ids — never raw node ids. `--kind` is a true resolve input; `--role` / `--java-kind` / `--fqn-contains` post-filter client-side.
99
101
 
100
- **Output.** Default is compact text; `--format json` emits `{status, nodes, edges, candidates, truncated, agent_next_actions, file_location}` (empty fields dropped; `file_location` is a `filename:line` string; `agent_next_actions` suggests ≤5 next commands). `truncated` pages via `--limit` / `--offset` (`find` / `search` only).
102
+ **Output.** Default is compact text; `--format json` emits `{status, nodes, edges, candidates, truncated, agent_next_actions, file_location}` (empty fields dropped; `file_location` is a `filename:line` string; `agent_next_actions` suggests ≤5 next commands). `truncated` pages via `--limit` / `--offset` (`find` / `search` only). Output-shaping flags (every query / listing / traversal command — not `status` / `microservices` / `vocab-index`, which reject them): `--count` prints just the result count (bare int in text; `{"status","count"}` in json), `--exists` prints `true`/`false` (`{"status","exists"}` in json) and exits 0 on a hit / 2 on a miss (scriptable existence gate — `find X --exists`, `inspect X --exists`), `--fields fqn,role,…` projects each node to a comma-separated field allowlist (overrides `--detail`; ignored with `--count`/`--exists`; primarily a `--format json` lever).
101
103
 
102
104
  **Edge semantics `--help` doesn't spell out.** `callers` / `callees` = `CALLS` in/out (on a controller/entry-point type, `callers` also lists the routes its methods `EXPOSE`). `impact` = bounded fan-in over `INJECTS` / `IMPLEMENTS` / `EXTENDS` (default depth 2; raise with `--depth`). `flow <route>` follows `EXPOSES` → `HTTP_CALLS` / `ASYNC_CALLS` → `CALLS`. `connection <microservice>` = inbound/outbound cross-service seams (its positional is a literal service name, not a query). Per-command edge mappings and the rest of the flag surface live in each command's `--help`.
103
105
 
@@ -94,9 +94,11 @@ The Decision Framework above tells you *which* command; reach for `--help` only
94
94
 
95
95
  **Prerequisite.** `jrag` needs an index — unindexed, every command exits 2 (`jrag status` checks; the file-system tools work without one).
96
96
 
97
+ **Tip.** Run `jrag watch` once per session for fast, fresh queries — it keeps the index fresh on file change and serves every read command warm (no per-call model load). Optional; with no daemon running, all reads take the cold path byte-identically.
98
+
97
99
  **Resolve-first contract.** Every `<query>` command resolves the identifier first, then maps `one` / `many` / `none` onto one envelope: `one` → run; `many` → return candidates and stop, **no silent guess across distinct types** (a class sharing its simple name with its own constructor still resolves to the type — narrow with `--kind` / `--role` / `--fqn-contains` / `--service`); `none` → `status: not_found` (exit 0), fall back to `search` or `Grep`. Pass names (FQN / simple name / route path / topic) or prior `sym:`/`route:`/`client:`/`producer:` ids — never raw node ids. `--kind` is a true resolve input; `--role` / `--java-kind` / `--fqn-contains` post-filter client-side.
98
100
 
99
- **Output.** Default is compact text; `--format json` emits `{status, nodes, edges, candidates, truncated, agent_next_actions, file_location}` (empty fields dropped; `file_location` is a `filename:line` string; `agent_next_actions` suggests ≤5 next commands). `truncated` pages via `--limit` / `--offset` (`find` / `search` only).
101
+ **Output.** Default is compact text; `--format json` emits `{status, nodes, edges, candidates, truncated, agent_next_actions, file_location}` (empty fields dropped; `file_location` is a `filename:line` string; `agent_next_actions` suggests ≤5 next commands). `truncated` pages via `--limit` / `--offset` (`find` / `search` only). Output-shaping flags (every query / listing / traversal command — not `status` / `microservices` / `vocab-index`, which reject them): `--count` prints just the result count (bare int in text; `{"status","count"}` in json), `--exists` prints `true`/`false` (`{"status","exists"}` in json) and exits 0 on a hit / 2 on a miss (scriptable existence gate — `find X --exists`, `inspect X --exists`), `--fields fqn,role,…` projects each node to a comma-separated field allowlist (overrides `--detail`; ignored with `--count`/`--exists`; primarily a `--format json` lever).
100
102
 
101
103
  **Edge semantics `--help` doesn't spell out.** `callers` / `callees` = `CALLS` in/out (on a controller/entry-point type, `callers` also lists the routes its methods `EXPOSE`). `impact` = bounded fan-in over `INJECTS` / `IMPLEMENTS` / `EXTENDS` (default depth 2; raise with `--depth`). `flow <route>` follows `EXPOSES` → `HTTP_CALLS` / `ASYNC_CALLS` → `CALLS`. `connection <microservice>` = inbound/outbound cross-service seams (its positional is a literal service name, not a query). Per-command edge mappings and the rest of the flag surface live in each command's `--help`.
102
104