[project] name = "cognirepo" version = "2.4.1" description = "Local cognitive infrastructure layer for AI agents" readme = "README.md" requires-python = ">=3.11,<3.15" license = "MIT" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Software Development :: Version Control", "Typing :: Typed", ] dependencies = [ # core "faiss-cpu==1.13.2", "numpy==2.4.4", # ONNX-based embeddings — no PyTorch/CUDA. ~50 MB install vs ~2 GB. # Same model (all-MiniLM-L6-v2, dim=384) as before. "fastembed>=0.3.6", # MCP server "mcp[cli]==1.28.1", # REST API + Server "fastapi>=0.115.0", "uvicorn>=0.30.0", "httpx>=0.27.0", # graph + indexer "networkx>=3.3", "watchdog>=4.0", "tree-sitter>=0.23", # shared "pydantic==2.13.3", # env loading "python-dotenv>=1.0", # BM25 keyword retrieval (episodic search) "rank-bm25>=0.2.2", # cross-process file locking (concurrent agent writes) "filelock>=3.12", # token counting — hard dependency, no silent fallback "tiktoken>=0.7", # system metrics + connectivity "psutil>=6.0", "requests>=2.33", "python-multipart>=0.0.30", ] [project.urls] Homepage = "https://github.com/ashlesh-t/cognirepo" "Bug Tracker" = "https://github.com/ashlesh-t/cognirepo/issues" Documentation = "https://github.com/ashlesh-t/cognirepo/blob/main/docs/ARCHITECTURE.md" Changelog = "https://github.com/ashlesh-t/cognirepo/blob/main/CHANGELOG.md" Discord = "https://discord.com/channels/1488386981917360289/1488387271190380636" [project.optional-dependencies] languages = [ "tree-sitter-python>=0.23", "tree-sitter-javascript>=0.23", "tree-sitter-typescript>=0.23", "tree-sitter-java>=0.23", "tree-sitter-cpp>=0.23", "tree-sitter-go>=0.23", "tree-sitter-rust>=0.23", "tree-sitter-bash>=0.23", "tree-sitter-yaml>=0.6", ] cpp = [ "pybind11>=2.12", "scikit-build-core>=0.9", ] security = [ "cryptography>=50.0.0", "keyring>=25.0", ] cli = [ "tqdm>=4.60", ] providers = [ # Model routing for `cognirepo ask`. Not required for MCP index server. # Install: pip install 'cognirepo[providers]' "anthropic>=0.87.0", "google-genai>=0.3", "openai>=1.0", ] gpu = [ # GPU-accelerated embeddings via sentence-transformers + PyTorch CUDA. # Install: pip install 'cognirepo[gpu]' # Then: pip install torch --index-url https://download.pytorch.org/whl/cu121 "sentence-transformers==5.3.0", "torch>=2.0", ] dev = [ "pytest>=9.0.3", "pytest-asyncio>=0.23", "pytest-mock>=3.12", "pytest-cov>=5.0", "pytest-timeout>=2.3", "pytest-xdist>=3.5", "httpx>=0.28", "prometheus-client>=0.20", "build>=1.0", "bcrypt>=4.0", # Include providers so tests can import router/adapters without install hint "anthropic>=0.87.0", "google-genai>=0.3", "openai>=1.0", ] [project.scripts] cognirepo = "interface.cli.main:main" [tool.setuptools.packages.find] where = ["."] include = [ "cognirepo*", "core*", "data*", "intelligence*", "interface*", "ops*", ] exclude = ["venv*", "*.egg-info*"] [tool.setuptools.package-data] # .env.example must live INSIDE the cognirepo/ package dir to ship in the # wheel — package-data cannot include files at the repo root. The root copy # exists for dev installs; tests/test_release_fixes.py asserts both stay in sync. "cognirepo" = [".env.example"] [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" # ── optional C++ build ──────────────────────────────────────────────────────── # Activate by swapping [build-system] to: # requires = ["scikit-build-core>=0.9", "pybind11>=2.12"] # build-backend = "scikit_build_core.build" # and running: pip install . --config-settings=cmake.args=-DBUILD_EXT=ON [tool.pytest.ini_options] testpaths = ["tests"] asyncio_mode = "auto" # -n 2: limit to 2 workers to prevent system lag on high-core systems. # --dist worksteal: dynamic load balancing so slow tests don't bottleneck a worker. # Override per-run: pytest -n0 for single-process debugging or pytest -n auto for max performance. addopts = "-n 2 --dist worksteal" filterwarnings = [ "ignore::DeprecationWarning", "ignore::PendingDeprecationWarning", ] [tool.coverage.run] source = ["."] omit = [ "tests/*", "venv/*", ".venv/*", "scripts/*", "deploy/*", "docs/*", "*.egg-info/*", "setup.py", # Background / CLI-interactive / org-runtime modules with 0% pytest coverage. # These require live network, org setup, or interactive TTY — not unit-testable. "interface/cli/release_check.py", "interface/cli/wizard.py", "interface/cli/seed.py", "intelligence/indexer/doc_ingester.py", "intelligence/indexer/inter_repo_indexer.py", "data/memory/auto_store.py", "data/memory/cleanup_queue.py", "data/memory/project_memory.py", "interface/tools/behaviour_hook.py", "interface/tools/prime_session.py", "interface/tools/search_docs.py", "interface/tools/sync_claude_memory.py", ] [tool.coverage.report] exclude_lines = [ "pragma: no cover", "def __repr__", "if __name__ == .__main__.:", "raise NotImplementedError", "if TYPE_CHECKING:", "except ImportError:", ] fail_under = 50 [tool.pylint.messages_control] disable = [ # unresolvable without optional deps installed "import-error", "no-member", # subprocess check is handled by callers "subprocess-run-check", # too-few-public-methods is expected for middleware/stub/data classes "too-few-public-methods", # wrong-import-position is expected for guarded/lazy imports "wrong-import-position", # import-outside-toplevel is expected for optional/lazy imports throughout "import-outside-toplevel", # missing docstrings in tests and small helpers are fine "missing-function-docstring", "missing-class-docstring", "missing-module-docstring", # useless-object-inheritance: auto-generated proto files use `object` "useless-object-inheritance", # wrong-import-order: auto-generated proto files have non-standard ordering "wrong-import-order", # ungrouped-imports: minor style, not a bug "ungrouped-imports", # duplicate-code: informational only, not actionable in test infrastructure "duplicate-code", ] [tool.pylint.design] max-locals = 30 max-branches = 25 max-statements = 100 max-returns = 10 max-args = 12 max-positional-arguments = 12 max-attributes = 15