agent-coderag 1.3.1__tar.gz → 1.3.2__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 (66) hide show
  1. {agent_coderag-1.3.1/agent_coderag.egg-info → agent_coderag-1.3.2}/PKG-INFO +10 -3
  2. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/README.md +8 -1
  3. {agent_coderag-1.3.1 → agent_coderag-1.3.2/agent_coderag.egg-info}/PKG-INFO +10 -3
  4. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/agent_coderag.egg-info/requires.txt +1 -1
  5. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/core/manager.py +13 -0
  6. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/entry/cli.py +21 -3
  7. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/pyproject.toml +2 -2
  8. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_cli.py +26 -0
  9. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_manager_detailed.py +30 -1
  10. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/LICENSE +0 -0
  11. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/NOTICE +0 -0
  12. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/agent_coderag.egg-info/SOURCES.txt +0 -0
  13. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/agent_coderag.egg-info/dependency_links.txt +0 -0
  14. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/agent_coderag.egg-info/entry_points.txt +0 -0
  15. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/agent_coderag.egg-info/top_level.txt +0 -0
  16. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/__init__.py +0 -0
  17. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/core/__init__.py +0 -0
  18. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/core/constants.py +0 -0
  19. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/core/exceptions.py +0 -0
  20. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/core/interfaces.py +0 -0
  21. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/core/models.py +0 -0
  22. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/core/utils.py +0 -0
  23. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/discovery/__init__.py +0 -0
  24. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/discovery/dependency.py +0 -0
  25. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/discovery/java_discovery.py +0 -0
  26. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/discovery/manager.py +0 -0
  27. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/discovery/providers/__init__.py +0 -0
  28. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/discovery/providers/base.py +0 -0
  29. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/discovery/providers/csharp.py +0 -0
  30. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/discovery/providers/go.py +0 -0
  31. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/discovery/providers/java.py +0 -0
  32. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/discovery/providers/javascript.py +0 -0
  33. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/discovery/providers/python.py +0 -0
  34. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/discovery/providers/rust.py +0 -0
  35. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/entry/__init__.py +0 -0
  36. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/intelligence/__init__.py +0 -0
  37. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/intelligence/distiller.py +0 -0
  38. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/intelligence/embedder.py +0 -0
  39. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/parsers/__init__.py +0 -0
  40. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/parsers/languages.py +0 -0
  41. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/parsers/multi_parser.py +0 -0
  42. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/parsers/tree_sitter.py +0 -0
  43. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/storage/__init__.py +0 -0
  44. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/code_rag/storage/duckdb_impl.py +0 -0
  45. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/setup.cfg +0 -0
  46. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_cli_detailed.py +0 -0
  47. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_code_rag_simple.py +0 -0
  48. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_csharp_discovery_detailed.py +0 -0
  49. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_dependency_discovery.py +0 -0
  50. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_discovery_manager_detailed.py +0 -0
  51. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_discovery_providers_extra.py +0 -0
  52. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_discovery_python.py +0 -0
  53. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_distiller.py +0 -0
  54. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_distiller_extra.py +0 -0
  55. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_embedder.py +0 -0
  56. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_embedder_detailed.py +0 -0
  57. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_interfaces.py +0 -0
  58. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_js_discovery_detailed.py +0 -0
  59. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_languages.py +0 -0
  60. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_manager_extra.py +0 -0
  61. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_models.py +0 -0
  62. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_multi_parser.py +0 -0
  63. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_rust_discovery_detailed.py +0 -0
  64. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_storage_detailed.py +0 -0
  65. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_tree_sitter_parser.py +0 -0
  66. {agent_coderag-1.3.1 → agent_coderag-1.3.2}/tests/test_utils_detailed.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agent-coderag
3
- Version: 1.3.1
3
+ Version: 1.3.2
4
4
  Summary: Lightweight semantic code search and distillation utility for AI coding agents. It solves the API knowledge gap via real-time local signature extraction and intent analysis without PyTorch. Optimized for token efficiency, it compresses codebase context into compact semantic summaries stored in a local DuckDB vector similarity index.
5
5
  Author-email: Igor Boloban <naranor@gmail.com>
6
6
  License: MIT
@@ -24,7 +24,7 @@ License-File: LICENSE
24
24
  License-File: NOTICE
25
25
  Requires-Dist: duckdb
26
26
  Requires-Dist: numpy
27
- Requires-Dist: litellm
27
+ Requires-Dist: litellm==1.96.2
28
28
  Requires-Dist: onnxruntime
29
29
  Requires-Dist: tokenizers
30
30
  Requires-Dist: pydantic
@@ -123,10 +123,17 @@ If you don't configure an LLM provider, agent-coderag works in **100% Offline Mo
123
123
  # Index your entire project (respects .gitignore automatically)
124
124
  agent-coderag sync --all
125
125
 
126
+ # Trusted Maven/Gradle projects only: allow dependency resolution
127
+ agent-coderag sync --all --allow-build-execution
128
+
126
129
  # Perform a semantic search
127
130
  agent-coderag search "how does the authentication middleware work?"
128
131
  ```
129
132
 
133
+ Dependency build execution is disabled by default. Maven and Gradle build files
134
+ can execute repository-controlled code, so use `--allow-build-execution` only
135
+ after you have reviewed and trust the project.
136
+
130
137
  ### API Discovery
131
138
  Verify external library signatures without leaving the CLI:
132
139
  ```bash
@@ -146,7 +153,7 @@ agent-coderag api fmt
146
153
  | Language | Method | Discovery Source |
147
154
  | :--- | :--- | :--- |
148
155
  | **Python** | 3-Stage Probe | `.pyi` stubs, static source, or runtime `inspect` |
149
- | **Java** | Bytecode Reflection | JARs resolved via Maven (`pom.xml`) or Gradle |
156
+ | **Java** | Bytecode Reflection | JARs resolved via Maven or Gradle with explicit `--allow-build-execution` opt-in |
150
157
  | **Go** | Standard Tooling | Native `go doc -all` integration |
151
158
  | **TypeScript/JS** | Declaration Maps | `.d.ts` files from `node_modules` or `@types` |
152
159
  | **Rust** | Registry Analysis | Source code from Cargo registry via `cargo metadata` |
@@ -78,10 +78,17 @@ If you don't configure an LLM provider, agent-coderag works in **100% Offline Mo
78
78
  # Index your entire project (respects .gitignore automatically)
79
79
  agent-coderag sync --all
80
80
 
81
+ # Trusted Maven/Gradle projects only: allow dependency resolution
82
+ agent-coderag sync --all --allow-build-execution
83
+
81
84
  # Perform a semantic search
82
85
  agent-coderag search "how does the authentication middleware work?"
83
86
  ```
84
87
 
88
+ Dependency build execution is disabled by default. Maven and Gradle build files
89
+ can execute repository-controlled code, so use `--allow-build-execution` only
90
+ after you have reviewed and trust the project.
91
+
85
92
  ### API Discovery
86
93
  Verify external library signatures without leaving the CLI:
87
94
  ```bash
@@ -101,7 +108,7 @@ agent-coderag api fmt
101
108
  | Language | Method | Discovery Source |
102
109
  | :--- | :--- | :--- |
103
110
  | **Python** | 3-Stage Probe | `.pyi` stubs, static source, or runtime `inspect` |
104
- | **Java** | Bytecode Reflection | JARs resolved via Maven (`pom.xml`) or Gradle |
111
+ | **Java** | Bytecode Reflection | JARs resolved via Maven or Gradle with explicit `--allow-build-execution` opt-in |
105
112
  | **Go** | Standard Tooling | Native `go doc -all` integration |
106
113
  | **TypeScript/JS** | Declaration Maps | `.d.ts` files from `node_modules` or `@types` |
107
114
  | **Rust** | Registry Analysis | Source code from Cargo registry via `cargo metadata` |
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agent-coderag
3
- Version: 1.3.1
3
+ Version: 1.3.2
4
4
  Summary: Lightweight semantic code search and distillation utility for AI coding agents. It solves the API knowledge gap via real-time local signature extraction and intent analysis without PyTorch. Optimized for token efficiency, it compresses codebase context into compact semantic summaries stored in a local DuckDB vector similarity index.
5
5
  Author-email: Igor Boloban <naranor@gmail.com>
6
6
  License: MIT
@@ -24,7 +24,7 @@ License-File: LICENSE
24
24
  License-File: NOTICE
25
25
  Requires-Dist: duckdb
26
26
  Requires-Dist: numpy
27
- Requires-Dist: litellm
27
+ Requires-Dist: litellm==1.96.2
28
28
  Requires-Dist: onnxruntime
29
29
  Requires-Dist: tokenizers
30
30
  Requires-Dist: pydantic
@@ -123,10 +123,17 @@ If you don't configure an LLM provider, agent-coderag works in **100% Offline Mo
123
123
  # Index your entire project (respects .gitignore automatically)
124
124
  agent-coderag sync --all
125
125
 
126
+ # Trusted Maven/Gradle projects only: allow dependency resolution
127
+ agent-coderag sync --all --allow-build-execution
128
+
126
129
  # Perform a semantic search
127
130
  agent-coderag search "how does the authentication middleware work?"
128
131
  ```
129
132
 
133
+ Dependency build execution is disabled by default. Maven and Gradle build files
134
+ can execute repository-controlled code, so use `--allow-build-execution` only
135
+ after you have reviewed and trust the project.
136
+
130
137
  ### API Discovery
131
138
  Verify external library signatures without leaving the CLI:
132
139
  ```bash
@@ -146,7 +153,7 @@ agent-coderag api fmt
146
153
  | Language | Method | Discovery Source |
147
154
  | :--- | :--- | :--- |
148
155
  | **Python** | 3-Stage Probe | `.pyi` stubs, static source, or runtime `inspect` |
149
- | **Java** | Bytecode Reflection | JARs resolved via Maven (`pom.xml`) or Gradle |
156
+ | **Java** | Bytecode Reflection | JARs resolved via Maven or Gradle with explicit `--allow-build-execution` opt-in |
150
157
  | **Go** | Standard Tooling | Native `go doc -all` integration |
151
158
  | **TypeScript/JS** | Declaration Maps | `.d.ts` files from `node_modules` or `@types` |
152
159
  | **Rust** | Registry Analysis | Source code from Cargo registry via `cargo metadata` |
@@ -1,6 +1,6 @@
1
1
  duckdb
2
2
  numpy
3
- litellm
3
+ litellm==1.96.2
4
4
  onnxruntime
5
5
  tokenizers
6
6
  pydantic
@@ -25,11 +25,13 @@ class CodeRAGManager:
25
25
  parser: IParser,
26
26
  intelligence: IIntelligence,
27
27
  max_concurrency: int = MAX_CONCURRENT_TASKS,
28
+ allow_build_execution: bool = False,
28
29
  ):
29
30
  self.storage = storage
30
31
  self.parser = parser
31
32
  self.intelligence = intelligence
32
33
  self.max_concurrency = max_concurrency
34
+ self.allow_build_execution = allow_build_execution
33
35
  self.semaphore = asyncio.Semaphore(max_concurrency)
34
36
  self.discovery = DiscoveryManager(storage=storage)
35
37
 
@@ -41,6 +43,17 @@ class CodeRAGManager:
41
43
  pom_xml = root / "pom.xml"
42
44
  gradle_files = list(root.glob("build.gradle*"))
43
45
 
46
+ if not pom_xml.exists() and not gradle_files:
47
+ return
48
+
49
+ if not self.allow_build_execution:
50
+ logger.warning(
51
+ "Dependency sync is disabled by default because Maven/Gradle "
52
+ "build files are executable repository code. Use the explicit "
53
+ "allow_build_execution option only for trusted projects."
54
+ )
55
+ return
56
+
44
57
  if pom_xml.exists():
45
58
  await self._sync_maven(root)
46
59
  elif gradle_files:
@@ -61,7 +61,11 @@ async def sync_cmd(args):
61
61
  if args.path:
62
62
  args.path = str(validate_path(args.path))
63
63
 
64
- manager = get_manager(args.db, args.onnx)
64
+ manager = get_manager(
65
+ args.db,
66
+ args.onnx,
67
+ allow_build_execution=getattr(args, "allow_build_execution", False),
68
+ )
65
69
  try:
66
70
  ignore_spec = load_ignore_patterns()
67
71
 
@@ -244,7 +248,11 @@ async def rebuild_cmd(args):
244
248
  await sync_cmd(args)
245
249
 
246
250
 
247
- def get_manager(db_path: str, onnx_path: Optional[str] = None) -> CodeRAGManager:
251
+ def get_manager(
252
+ db_path: str,
253
+ onnx_path: Optional[str] = None,
254
+ allow_build_execution: bool = False,
255
+ ) -> CodeRAGManager:
248
256
  # 1. Setup Intelligence
249
257
  config = DistillerConfig.load()
250
258
  distiller = Distiller(config)
@@ -256,7 +264,12 @@ def get_manager(db_path: str, onnx_path: Optional[str] = None) -> CodeRAGManager
256
264
  # 3. Setup Parser
257
265
  parser = MultiParser()
258
266
 
259
- return CodeRAGManager(storage, parser, distiller)
267
+ return CodeRAGManager(
268
+ storage,
269
+ parser,
270
+ distiller,
271
+ allow_build_execution=allow_build_execution,
272
+ )
260
273
 
261
274
 
262
275
  def main():
@@ -277,6 +290,11 @@ def main():
277
290
  sync.add_argument("path", nargs="?", help="File or directory to index.")
278
291
  sync.add_argument("--all", action="store_true", help="Index all supported files.")
279
292
  sync.add_argument("--force", action="store_true", help="Force re-distillation.")
293
+ sync.add_argument(
294
+ "--allow-build-execution",
295
+ action="store_true",
296
+ help="Execute repository Maven/Gradle build files during dependency sync (trusted projects only).",
297
+ )
280
298
 
281
299
  # Search
282
300
  search = subparsers.add_parser("search", help="Semantic search.")
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "agent-coderag"
7
- version = "1.3.1"
7
+ version = "1.3.2"
8
8
  description = "Lightweight semantic code search and distillation utility for AI coding agents. It solves the API knowledge gap via real-time local signature extraction and intent analysis without PyTorch. Optimized for token efficiency, it compresses codebase context into compact semantic summaries stored in a local DuckDB vector similarity index."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -27,7 +27,7 @@ classifiers = [
27
27
  dependencies = [
28
28
  "duckdb",
29
29
  "numpy",
30
- "litellm",
30
+ "litellm==1.96.2",
31
31
  "onnxruntime",
32
32
  "tokenizers",
33
33
  "pydantic",
@@ -86,6 +86,32 @@ class TestCLISync:
86
86
  finally:
87
87
  sys.stdout = old_stdout
88
88
 
89
+ @pytest.mark.asyncio
90
+ async def test_sync_cmd_propagates_build_execution_flag(self, tmp_path):
91
+ """Test the --allow-build-execution opt-in reaches the manager."""
92
+ mock_manager = MagicMock()
93
+ mock_manager.sync_project = AsyncMock()
94
+ mock_manager.sync_dependencies = AsyncMock()
95
+ mock_manager.close = AsyncMock()
96
+
97
+ with patch(
98
+ "code_rag.entry.cli.get_manager", return_value=mock_manager
99
+ ) as mock_get_manager:
100
+ args = argparse.Namespace(
101
+ db=str(tmp_path / "test.db"),
102
+ onnx=None,
103
+ verbose=False,
104
+ json=False,
105
+ path=None,
106
+ all=True,
107
+ force=False,
108
+ allow_build_execution=True,
109
+ )
110
+
111
+ await cli.sync_cmd(args)
112
+
113
+ assert mock_get_manager.call_args.kwargs["allow_build_execution"] is True
114
+
89
115
  @pytest.mark.asyncio
90
116
  async def test_sync_cmd_file(self, tmp_path):
91
117
  """Test sync command for a single file."""
@@ -1,7 +1,9 @@
1
- import pytest
1
+ import logging
2
2
  import os
3
3
  from unittest.mock import MagicMock, AsyncMock, patch
4
4
 
5
+ import pytest
6
+
5
7
  from code_rag.core.manager import CodeRAGManager
6
8
  from code_rag.core.interfaces import IStorage, IParser, IIntelligence
7
9
  from code_rag.core.models import KnowledgeUnit, UnitKind
@@ -44,6 +46,7 @@ class TestManagerDetailed:
44
46
  @pytest.mark.asyncio
45
47
  async def test_sync_dependencies_maven(self, manager, tmp_path):
46
48
  """Test Maven dependency synchronization."""
49
+ manager.allow_build_execution = True
47
50
  (tmp_path / "pom.xml").write_text("<project></project>")
48
51
 
49
52
  with patch("shutil.which", return_value="/usr/bin/mvn"), patch(
@@ -68,6 +71,7 @@ class TestManagerDetailed:
68
71
  @pytest.mark.asyncio
69
72
  async def test_sync_dependencies_gradle(self, manager, tmp_path):
70
73
  """Test Gradle dependency synchronization."""
74
+ manager.allow_build_execution = True
71
75
  (tmp_path / "build.gradle").write_text("apply plugin: 'java'")
72
76
 
73
77
  with patch("shutil.which", return_value="/usr/bin/gradle"), patch(
@@ -85,6 +89,31 @@ class TestManagerDetailed:
85
89
  "lib-gradle", "lib-gradle.jar"
86
90
  )
87
91
 
92
+ @pytest.mark.asyncio
93
+ async def test_sync_dependencies_non_java_does_not_warn(
94
+ self, manager, tmp_path, caplog
95
+ ):
96
+ """Test dependency synchronization stays quiet without build files."""
97
+ with caplog.at_level(logging.WARNING):
98
+ await manager.sync_dependencies(str(tmp_path))
99
+
100
+ assert not caplog.records
101
+
102
+ @pytest.mark.asyncio
103
+ async def test_sync_dependencies_requires_build_execution_opt_in(
104
+ self, manager, tmp_path, caplog
105
+ ):
106
+ """Test repository build files are not executed without explicit opt-in."""
107
+ (tmp_path / "pom.xml").write_text("<project></project>")
108
+
109
+ with caplog.at_level(logging.WARNING), patch(
110
+ "asyncio.create_subprocess_exec"
111
+ ) as mock_exec:
112
+ await manager.sync_dependencies(str(tmp_path))
113
+
114
+ mock_exec.assert_not_called()
115
+ assert "Dependency sync is disabled by default" in caplog.text
116
+
88
117
  @pytest.mark.asyncio
89
118
  async def test_sync_file_delta_logic(self, manager, mock_storage, mock_parser):
90
119
  """Test sync_file with delta distillation logic."""
File without changes
File without changes
File without changes