nova-rag 0.1.0__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 (38) hide show
  1. nova_rag-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +33 -0
  2. nova_rag-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +22 -0
  3. nova_rag-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +19 -0
  4. nova_rag-0.1.0/.github/workflows/tests.yml +31 -0
  5. nova_rag-0.1.0/.gitignore +13 -0
  6. nova_rag-0.1.0/CLAUDE.md +48 -0
  7. nova_rag-0.1.0/CODE_OF_CONDUCT.md +28 -0
  8. nova_rag-0.1.0/CONTRIBUTING.md +89 -0
  9. nova_rag-0.1.0/LICENSE +21 -0
  10. nova_rag-0.1.0/PKG-INFO +777 -0
  11. nova_rag-0.1.0/README.md +741 -0
  12. nova_rag-0.1.0/SECURITY.md +26 -0
  13. nova_rag-0.1.0/pyproject.toml +57 -0
  14. nova_rag-0.1.0/src/nova_rag/__init__.py +3 -0
  15. nova_rag-0.1.0/src/nova_rag/__main__.py +5 -0
  16. nova_rag-0.1.0/src/nova_rag/chunker.py +348 -0
  17. nova_rag-0.1.0/src/nova_rag/config.py +108 -0
  18. nova_rag-0.1.0/src/nova_rag/git_intel.py +136 -0
  19. nova_rag-0.1.0/src/nova_rag/graph.py +501 -0
  20. nova_rag-0.1.0/src/nova_rag/indexer.py +322 -0
  21. nova_rag-0.1.0/src/nova_rag/searcher.py +394 -0
  22. nova_rag-0.1.0/src/nova_rag/server.py +266 -0
  23. nova_rag-0.1.0/src/nova_rag/store.py +836 -0
  24. nova_rag-0.1.0/src/nova_rag/watcher.py +161 -0
  25. nova_rag-0.1.0/tests/__init__.py +0 -0
  26. nova_rag-0.1.0/tests/conftest.py +83 -0
  27. nova_rag-0.1.0/tests/fixtures/graph_sample.py +58 -0
  28. nova_rag-0.1.0/tests/fixtures/sample.py +38 -0
  29. nova_rag-0.1.0/tests/fixtures/sample.ts +31 -0
  30. nova_rag-0.1.0/tests/fixtures/sample_unknown.txt +7 -0
  31. nova_rag-0.1.0/tests/test_chunker.py +107 -0
  32. nova_rag-0.1.0/tests/test_graph.py +239 -0
  33. nova_rag-0.1.0/tests/test_impact.py +159 -0
  34. nova_rag-0.1.0/tests/test_indexer.py +73 -0
  35. nova_rag-0.1.0/tests/test_searcher.py +91 -0
  36. nova_rag-0.1.0/tests/test_server.py +117 -0
  37. nova_rag-0.1.0/tests/test_smart_router.py +80 -0
  38. nova_rag-0.1.0/tests/test_store.py +142 -0
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Something isn't working as expected
4
+ title: "[Bug] "
5
+ labels: bug
6
+ ---
7
+
8
+ ## What happened?
9
+
10
+ A clear description of the bug.
11
+
12
+ ## What did you expect?
13
+
14
+ What should have happened instead.
15
+
16
+ ## Steps to reproduce
17
+
18
+ 1. ...
19
+ 2. ...
20
+ 3. ...
21
+
22
+ ## Environment
23
+
24
+ - OS:
25
+ - Python version:
26
+ - nova-rag version:
27
+ - MCP client (Claude Code / Cursor / other):
28
+
29
+ ## Error output
30
+
31
+ ```
32
+ Paste any error messages here
33
+ ```
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest a new feature or improvement
4
+ title: "[Feature] "
5
+ labels: enhancement
6
+ ---
7
+
8
+ ## Problem
9
+
10
+ What problem does this solve? Why is it needed?
11
+
12
+ ## Proposed solution
13
+
14
+ How do you imagine it working?
15
+
16
+ ## Alternatives considered
17
+
18
+ Any other approaches you've thought about?
19
+
20
+ ## Additional context
21
+
22
+ Screenshots, code examples, links to similar features in other tools.
@@ -0,0 +1,19 @@
1
+ ## What does this PR do?
2
+
3
+ Brief description of changes.
4
+
5
+ ## Why?
6
+
7
+ What problem does it solve or what feature does it add?
8
+
9
+ ## How to test
10
+
11
+ 1. ...
12
+ 2. ...
13
+
14
+ ## Checklist
15
+
16
+ - [ ] Tests added/updated
17
+ - [ ] All 99+ tests pass (`pytest tests/ -v`)
18
+ - [ ] Documentation updated (if needed)
19
+ - [ ] No new dependencies added (or justified why)
@@ -0,0 +1,31 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ matrix:
14
+ os: [ubuntu-latest, macos-latest]
15
+ python-version: ["3.11", "3.12", "3.13"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Set up Python ${{ matrix.python-version }}
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: ${{ matrix.python-version }}
24
+
25
+ - name: Install dependencies
26
+ run: |
27
+ python -m pip install --upgrade pip
28
+ pip install -e ".[dev]"
29
+
30
+ - name: Run tests
31
+ run: pytest tests/ -v
@@ -0,0 +1,13 @@
1
+ __pycache__/
2
+ *.pyc
3
+ *.pyo
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .eggs/
8
+ .venv/
9
+ venv/
10
+ .mypy_cache/
11
+ .pytest_cache/
12
+ .tox/
13
+ *.so
@@ -0,0 +1,48 @@
1
+ # nova-rag — Code Intelligence MCP Server
2
+
3
+ ## For users: add to your project's CLAUDE.md
4
+
5
+ ```markdown
6
+ ## Code Search (nova-rag)
7
+
8
+ This project has a local code intelligence index. Use `code_search` — it auto-detects what you need:
9
+
10
+ - "where is payment processing?" → semantic search with graph context
11
+ - "who calls handleAuth?" → call graph: all callers
12
+ - "what does processData call?" → call graph: all callees
13
+ - "who imports psycopg2?" → import graph
14
+ - "dead code in src/auth" → unused function detection
15
+ - "class hierarchy of UserService" → inheritance tree
16
+ - "impact of changing validate" → blast radius analysis
17
+ - "what changed this week?" → git change intelligence
18
+
19
+ Search results include `callers`/`callees` — use them for full context.
20
+ For exact string matches (TODOs, error messages), use Grep.
21
+ ```
22
+
23
+ ## For nova-rag developers
24
+
25
+ ### Build and test
26
+ ```bash
27
+ pip install -e ".[dev]"
28
+ pytest tests/ -v # 99 tests
29
+ ```
30
+
31
+ ### Architecture
32
+ - `server.py` — MCP entry point, 11 tools (code_search = smart router)
33
+ - `searcher.py` — smart router + hybrid search + graph queries + deadcode + impact
34
+ - `indexer.py` — multithreaded: ThreadPoolExecutor for chunking/graph, sequential embedding
35
+ - `chunker.py` — tree-sitter AST parsing (7 languages) + sliding window fallback
36
+ - `graph.py` — symbols, calls, imports, inheritance extraction from tree-sitter AST
37
+ - `git_intel.py` — git change intelligence mapped to code graph
38
+ - `store.py` — FAISS vectors + SQLite (FTS5 + graph tables + inheritance)
39
+ - `watcher.py` — watchdog file watcher for auto-reindex
40
+ - `config.py` — env var configuration
41
+
42
+ ### Key decisions
43
+ - Smart router detects intent from query via regex patterns
44
+ - Hybrid search via RRF (Reciprocal Rank Fusion) from FAISS + FTS5
45
+ - Code graph stored in SQLite (symbols, calls, imports, inheritance tables)
46
+ - Impact analysis: recursive transitive caller graph traversal
47
+ - Multithreading: file processing in parallel, embedding/store sequential
48
+ - Embedding model pre-loaded in background thread at startup
@@ -0,0 +1,28 @@
1
+ # Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ ## Our Standards
8
+
9
+ **Positive behavior:**
10
+ - Using welcoming and inclusive language
11
+ - Being respectful of differing viewpoints
12
+ - Gracefully accepting constructive criticism
13
+ - Focusing on what is best for the community
14
+
15
+ **Unacceptable behavior:**
16
+ - Trolling, insulting comments, and personal attacks
17
+ - Harassment in any form
18
+ - Publishing others' private information without permission
19
+
20
+ ## Enforcement
21
+
22
+ Project maintainers are responsible for clarifying standards of acceptable behavior and will take appropriate action in response to unacceptable behavior.
23
+
24
+ Instances of abusive behavior may be reported by opening an issue or contacting the maintainers directly.
25
+
26
+ ## Attribution
27
+
28
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1.
@@ -0,0 +1,89 @@
1
+ # Contributing to nova-rag
2
+
3
+ Thanks for your interest in contributing! nova-rag is a community-driven project and every contribution matters.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ git clone https://github.com/Miro96/nova-rag.git
9
+ cd nova-rag
10
+ pip install -e ".[dev]"
11
+ pytest tests/ -v # 99 tests should pass
12
+ ```
13
+
14
+ ## How to Contribute
15
+
16
+ ### Reporting Bugs
17
+
18
+ Open an [issue](https://github.com/Miro96/nova-rag/issues/new?template=bug_report.md) with:
19
+ - What you expected to happen
20
+ - What actually happened
21
+ - Steps to reproduce
22
+ - Your environment (OS, Python version, nova-rag version)
23
+
24
+ ### Suggesting Features
25
+
26
+ Open an [issue](https://github.com/Miro96/nova-rag/issues/new?template=feature_request.md) with:
27
+ - What problem it solves
28
+ - How you imagine it working
29
+ - Why it belongs in nova-rag (not a separate tool)
30
+
31
+ ### Submitting Code
32
+
33
+ 1. Fork the repo
34
+ 2. Create a feature branch from `main`:
35
+ ```bash
36
+ git checkout -b feature/my-feature
37
+ ```
38
+ 3. Make your changes
39
+ 4. Write tests for new functionality
40
+ 5. Ensure all tests pass:
41
+ ```bash
42
+ pytest tests/ -v
43
+ ```
44
+ 6. Commit with a clear message:
45
+ ```bash
46
+ git commit -m "Add: description of what you added"
47
+ ```
48
+ 7. Push and open a Pull Request
49
+
50
+ ### What We're Looking For
51
+
52
+ High-impact contributions:
53
+ - **New languages** — add tree-sitter grammars + call/import/inheritance extraction in `graph.py`
54
+ - **Smart router intents** — new query patterns in `searcher.py`
55
+ - **Better graph analysis** — deeper impact analysis, cycle detection, etc.
56
+ - **Performance** — faster indexing, lower memory usage
57
+ - **Tests** — more edge cases, integration tests
58
+
59
+ ### Adding a New Language
60
+
61
+ Each language needs changes in 3 files:
62
+
63
+ 1. **`chunker.py`** — add to `_LANGUAGE_CONFIGS` (tree-sitter grammar + node types)
64
+ 2. **`graph.py`** — add to `_CALL_TYPES`, `_IMPORT_TYPES`, `_DEFINITION_TYPES`, `_CLASS_TYPES`
65
+ 3. **`pyproject.toml`** — add `tree-sitter-<language>` dependency
66
+
67
+ See existing languages as examples. Each new language should include tests in `tests/fixtures/`.
68
+
69
+ ## Code Style
70
+
71
+ - Python 3.11+ type hints
72
+ - No external linter enforced — just keep it consistent with existing code
73
+ - Tests for every new feature
74
+ - Docstrings for public functions
75
+
76
+ ## Commit Messages
77
+
78
+ ```
79
+ Add: new feature description
80
+ Fix: bug description
81
+ Update: existing feature change
82
+ Remove: removed feature
83
+ Docs: documentation change
84
+ Test: test addition/change
85
+ ```
86
+
87
+ ## Questions?
88
+
89
+ Open a [discussion](https://github.com/Miro96/nova-rag/discussions) or ask in an issue. No question is too small.
nova_rag-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vladimir Pronevic
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.