codevira 1.6.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.
- codevira-1.6.0/CHANGELOG.md +304 -0
- codevira-1.6.0/LICENSE +21 -0
- codevira-1.6.0/MANIFEST.in +8 -0
- codevira-1.6.0/PKG-INFO +477 -0
- codevira-1.6.0/README.md +436 -0
- codevira-1.6.0/agents/builder.md +84 -0
- codevira-1.6.0/agents/developer.md +111 -0
- codevira-1.6.0/agents/documenter.md +138 -0
- codevira-1.6.0/agents/orchestrator.md +96 -0
- codevira-1.6.0/agents/planner.md +106 -0
- codevira-1.6.0/agents/reviewer.md +82 -0
- codevira-1.6.0/agents/tester.md +83 -0
- codevira-1.6.0/codevira.egg-info/PKG-INFO +477 -0
- codevira-1.6.0/codevira.egg-info/SOURCES.txt +115 -0
- codevira-1.6.0/codevira.egg-info/dependency_links.txt +1 -0
- codevira-1.6.0/codevira.egg-info/entry_points.txt +2 -0
- codevira-1.6.0/codevira.egg-info/requires.txt +17 -0
- codevira-1.6.0/codevira.egg-info/top_level.txt +2 -0
- codevira-1.6.0/config.example.yaml +33 -0
- codevira-1.6.0/docs/how-i-built-persistent-memory-for-ai-agents.md +375 -0
- codevira-1.6.0/docs/linkedin-article-ai-agent-memory.md +157 -0
- codevira-1.6.0/docs/linkedin-post-ai-agent-memory.md +54 -0
- codevira-1.6.0/docs/medium-your-ai-coding-agent-has-amnesia.md +266 -0
- codevira-1.6.0/docs/roadmap.md +285 -0
- codevira-1.6.0/graph/_schema.yaml +71 -0
- codevira-1.6.0/indexer/__init__.py +1 -0
- codevira-1.6.0/indexer/chunker.py +428 -0
- codevira-1.6.0/indexer/global_db.py +197 -0
- codevira-1.6.0/indexer/graph_generator.py +380 -0
- codevira-1.6.0/indexer/index_codebase.py +588 -0
- codevira-1.6.0/indexer/outcome_tracker.py +172 -0
- codevira-1.6.0/indexer/rule_learner.py +186 -0
- codevira-1.6.0/indexer/sqlite_graph.py +640 -0
- codevira-1.6.0/indexer/treesitter_parser.py +423 -0
- codevira-1.6.0/mcp_server/__init__.py +1 -0
- codevira-1.6.0/mcp_server/__main__.py +20 -0
- codevira-1.6.0/mcp_server/auto_init.py +257 -0
- codevira-1.6.0/mcp_server/cli.py +622 -0
- codevira-1.6.0/mcp_server/crash_logger.py +236 -0
- codevira-1.6.0/mcp_server/data/__init__.py +1 -0
- codevira-1.6.0/mcp_server/data/agents/builder.md +84 -0
- codevira-1.6.0/mcp_server/data/agents/developer.md +111 -0
- codevira-1.6.0/mcp_server/data/agents/documenter.md +138 -0
- codevira-1.6.0/mcp_server/data/agents/orchestrator.md +96 -0
- codevira-1.6.0/mcp_server/data/agents/planner.md +106 -0
- codevira-1.6.0/mcp_server/data/agents/reviewer.md +82 -0
- codevira-1.6.0/mcp_server/data/agents/tester.md +83 -0
- codevira-1.6.0/mcp_server/data/config.example.yaml +33 -0
- codevira-1.6.0/mcp_server/data/rules/coding-standards.md +48 -0
- codevira-1.6.0/mcp_server/data/rules/engineering-excellence.md +28 -0
- codevira-1.6.0/mcp_server/data/rules/git-cicd-governance.md +32 -0
- codevira-1.6.0/mcp_server/data/rules/git_commits.md +130 -0
- codevira-1.6.0/mcp_server/data/rules/incremental-updates.md +5 -0
- codevira-1.6.0/mcp_server/data/rules/master_rule.md +187 -0
- codevira-1.6.0/mcp_server/data/rules/multi-language.md +19 -0
- codevira-1.6.0/mcp_server/data/rules/persistence.md +21 -0
- codevira-1.6.0/mcp_server/data/rules/resilience-observability.md +17 -0
- codevira-1.6.0/mcp_server/data/rules/smoke-testing.md +48 -0
- codevira-1.6.0/mcp_server/data/rules/testing-standards.md +23 -0
- codevira-1.6.0/mcp_server/detect.py +284 -0
- codevira-1.6.0/mcp_server/gitignore.py +284 -0
- codevira-1.6.0/mcp_server/global_sync.py +187 -0
- codevira-1.6.0/mcp_server/http_server.py +341 -0
- codevira-1.6.0/mcp_server/ide_inject.py +444 -0
- codevira-1.6.0/mcp_server/launchd.py +156 -0
- codevira-1.6.0/mcp_server/migrate.py +215 -0
- codevira-1.6.0/mcp_server/paths.py +256 -0
- codevira-1.6.0/mcp_server/prompts.py +136 -0
- codevira-1.6.0/mcp_server/server.py +1049 -0
- codevira-1.6.0/mcp_server/tools/__init__.py +0 -0
- codevira-1.6.0/mcp_server/tools/changesets.py +223 -0
- codevira-1.6.0/mcp_server/tools/code_reader.py +335 -0
- codevira-1.6.0/mcp_server/tools/graph.py +637 -0
- codevira-1.6.0/mcp_server/tools/learning.py +238 -0
- codevira-1.6.0/mcp_server/tools/playbook.py +89 -0
- codevira-1.6.0/mcp_server/tools/roadmap.py +599 -0
- codevira-1.6.0/mcp_server/tools/search.py +145 -0
- codevira-1.6.0/pyproject.toml +81 -0
- codevira-1.6.0/rules/coding-standards.md +48 -0
- codevira-1.6.0/rules/engineering-excellence.md +28 -0
- codevira-1.6.0/rules/git-cicd-governance.md +32 -0
- codevira-1.6.0/rules/git_commits.md +130 -0
- codevira-1.6.0/rules/incremental-updates.md +5 -0
- codevira-1.6.0/rules/master_rule.md +187 -0
- codevira-1.6.0/rules/persistence.md +21 -0
- codevira-1.6.0/rules/resilience-observability.md +17 -0
- codevira-1.6.0/rules/smoke-testing.md +48 -0
- codevira-1.6.0/rules/testing-standards.md +23 -0
- codevira-1.6.0/setup.cfg +4 -0
- codevira-1.6.0/tests/test_auto_init.py +621 -0
- codevira-1.6.0/tests/test_chunker.py +875 -0
- codevira-1.6.0/tests/test_cli.py +950 -0
- codevira-1.6.0/tests/test_crash_logger.py +471 -0
- codevira-1.6.0/tests/test_detect.py +556 -0
- codevira-1.6.0/tests/test_gitignore.py +637 -0
- codevira-1.6.0/tests/test_global_db.py +807 -0
- codevira-1.6.0/tests/test_global_sync.py +325 -0
- codevira-1.6.0/tests/test_graph_generator.py +675 -0
- codevira-1.6.0/tests/test_http_server.py +580 -0
- codevira-1.6.0/tests/test_ide_inject.py +903 -0
- codevira-1.6.0/tests/test_index_codebase.py +1083 -0
- codevira-1.6.0/tests/test_launchd.py +349 -0
- codevira-1.6.0/tests/test_migrate.py +681 -0
- codevira-1.6.0/tests/test_outcome_tracker.py +333 -0
- codevira-1.6.0/tests/test_paths.py +730 -0
- codevira-1.6.0/tests/test_prompts.py +101 -0
- codevira-1.6.0/tests/test_rule_learner.py +411 -0
- codevira-1.6.0/tests/test_server.py +881 -0
- codevira-1.6.0/tests/test_sqlite_graph.py +877 -0
- codevira-1.6.0/tests/test_tools_changesets.py +424 -0
- codevira-1.6.0/tests/test_tools_code_reader.py +653 -0
- codevira-1.6.0/tests/test_tools_graph.py +912 -0
- codevira-1.6.0/tests/test_tools_learning.py +551 -0
- codevira-1.6.0/tests/test_tools_playbook.py +280 -0
- codevira-1.6.0/tests/test_tools_roadmap.py +621 -0
- codevira-1.6.0/tests/test_tools_search.py +484 -0
- codevira-1.6.0/tests/test_treesitter_parser.py +245 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Codevira MCP will be documented here.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
6
|
+
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## [Unreleased]
|
|
13
|
+
|
|
14
|
+
### Performance
|
|
15
|
+
- **`get_data_dir()` caching**: Result cached per project root in `_data_dir_cache`.
|
|
16
|
+
First call runs the full resolution chain (subprocess + metadata scan); all
|
|
17
|
+
subsequent calls for the same root are O(1) dict lookups with zero I/O.
|
|
18
|
+
- **`set_project_dir()` cache invalidation**: Changing the project root now clears
|
|
19
|
+
the data-dir cache so subsequent `get_data_dir()` calls resolve correctly.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- **Test isolation**: Autouse fixture now clears `_data_dir_cache` and resets
|
|
23
|
+
`_project_dir_override` between every test, preventing cross-test pollution.
|
|
24
|
+
- **`auto_init._init_done` renamed to `_init_started`**: The flag is set when the
|
|
25
|
+
background thread *starts*, not when it *finishes* — name now matches semantics.
|
|
26
|
+
- **Unbounded `join()` in auto-init**: Background semantic indexing thread now has
|
|
27
|
+
a 5-minute timeout; if it hangs, the server continues in graph-only mode.
|
|
28
|
+
- **`install_launchd()` missing `project_dir`**: Added optional `project_dir`
|
|
29
|
+
parameter. When provided, adds `--project-dir` to ProgramArguments and
|
|
30
|
+
`WorkingDirectory` to the launchd plist.
|
|
31
|
+
- **CLI `project_dir` not forwarded to launchd**: `cmd_serve()` now passes
|
|
32
|
+
`project_dir` through to `install_launchd()`.
|
|
33
|
+
- **`run_http_server()` ignoring `project_dir`**: Now calls `set_project_dir()`
|
|
34
|
+
when `project_dir` is not None, so direct callers get correct path resolution.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
- **README.md**: Updated for v1.6.0 — version badge, Quick Start flow (`register`
|
|
38
|
+
instead of `init`), centralized storage diagram, documented `codevira register`,
|
|
39
|
+
`--install-service`/`--uninstall-service`, auto-init, and legacy migration.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## [1.6.0] — 2026-04-03 — True Zero-Friction: No Init, No Config, Just Works
|
|
44
|
+
|
|
45
|
+
### Added — Centralized Storage
|
|
46
|
+
- **`~/.codevira/projects/<key>/`**: All project data now lives centrally, keyed by sanitized path. No more `.codevira/` directories polluting project repos.
|
|
47
|
+
- **`mcp_server/paths.py` v1.6 resolution chain**: `get_data_dir()` checks centralized dir → git remote lookup (survives renames) → legacy `<root>/.codevira/` fallback → defaults to centralized for new projects.
|
|
48
|
+
- **`_discover_project_root()`** now uses project markers (`.git`, `pyproject.toml`, `package.json`, `go.mod`, `Cargo.toml`) instead of requiring `.codevira/config.yaml`.
|
|
49
|
+
- **`mcp_server/migrate.py`** (NEW): `detect_migration_needed()` + `migrate_to_centralized()` — safe WAL-mode SQLite backup, copies graph.db/codeindex/config.yaml/roadmap.yaml, writes metadata.json, renames old `.codevira/` to `.codevira.migrated/` as safety net. Idempotent.
|
|
50
|
+
- **Auto-migration on server startup**: Both stdio (`server.py`) and HTTP (`http_server.py`) servers detect and migrate legacy projects automatically.
|
|
51
|
+
- **`indexer/global_db.py`**: Added `git_remote TEXT` column to `projects` table. `register_project()` now accepts `git_remote` parameter. New `find_project_by_remote()` method for rename-resilient lookup.
|
|
52
|
+
|
|
53
|
+
### Added — .gitignore-Aware File Discovery
|
|
54
|
+
- **`mcp_server/gitignore.py`** (NEW): `load_gitignore_spec()` recursively loads all `.gitignore` files (including nested). `discover_source_files()` walks the full project tree with gitignore + safety-net exclusions. `infer_language_from_files()` counts extensions to detect dominant language.
|
|
55
|
+
- **`pathspec>=0.12.0`** added as base dependency.
|
|
56
|
+
- **`mcp_server/detect.py`**: `_scan_dominant_language()` and `detect_watched_dirs()` now delegate to `discover_source_files()` + `infer_language_from_files()` with legacy fallback.
|
|
57
|
+
|
|
58
|
+
### Added — Auto-Init on First Tool Call
|
|
59
|
+
- **`mcp_server/auto_init.py`** (NEW): `ensure_project_initialized()` — fast-path no-op if already done, otherwise starts background thread that auto-detects project, creates centralized dirs, writes config.yaml + metadata.json, registers in global.db, builds graph and index.
|
|
60
|
+
- **`server.py call_tool()`**: Calls `ensure_project_initialized()` before every tool dispatch (< 1ms no-op overhead after first call).
|
|
61
|
+
- **Graceful degradation**: `search_codebase()` returns `{status: "indexing", message: "..."}` instead of error while index is building. `get_node()` returns `{status: "initializing", ...}` for missing nodes during graph build.
|
|
62
|
+
- **`get_session_context()`** now includes `indexing_progress` field when background init is running.
|
|
63
|
+
|
|
64
|
+
### Added — Global IDE Registration (v1.6)
|
|
65
|
+
- **`codevira register`** (NEW CLI subcommand): One-time global injection into all detected IDEs. Works for every project automatically. No per-project `init` required.
|
|
66
|
+
- **`codevira register --claude-desktop`**: Configure Claude Desktop specifically (stdio mode, full binary path, --project-dir).
|
|
67
|
+
- **`codevira register --http-url https://localhost:7443/mcp`**: Inject HTTP URL format into Claude Code global settings.
|
|
68
|
+
- **`mcp_server/ide_inject.py` v1.6**: Added Claude Desktop injection (`_inject_claude_desktop()`), global mode functions (`inject_global_claude_code/cursor/windsurf()`), HTTP URL injection (`inject_claude_http_url()`). Fixed Windows cross-platform bug (`sysconfig.get_path("posix_user")` → `"nt_user"` on Windows). Fixed Antigravity server name sanitization (regex handles all special chars).
|
|
69
|
+
|
|
70
|
+
### Added — macOS Service Auto-Start
|
|
71
|
+
- **`mcp_server/launchd.py`** (NEW): `install_launchd(port, use_https)` generates `~/Library/LaunchAgents/com.codevira.mcp-serve.plist` and loads it. `uninstall_launchd()` removes it. `launchd_status()` reports current state.
|
|
72
|
+
- **`codevira serve --install-service`**: Install macOS launchd plist so HTTP server starts on login.
|
|
73
|
+
- **`codevira serve --uninstall-service`**: Remove the launchd service.
|
|
74
|
+
|
|
75
|
+
### Fixed — Module-Level Path Evaluation
|
|
76
|
+
- **`indexer/index_codebase.py`**: Removed module-level `PROJECT_ROOT = get_project_root()` and `INDEX_DIR = get_data_dir() / "codeindex"`. Replaced with lazy `_project_root()` and `_index_dir()` functions. All 12 call sites updated.
|
|
77
|
+
- **`indexer/outcome_tracker.py`**: Removed module-level `PROJECT_ROOT = get_project_root()`. Replaced with lazy `_project_root()`. All 2 call sites updated.
|
|
78
|
+
- **`indexer/chunker.py`**: Removed module-level `_config = _load_config()` and derived variables. Replaced with `@functools.lru_cache` `_get_project_config()` function. All call sites updated.
|
|
79
|
+
|
|
80
|
+
### Fixed — Thread Safety
|
|
81
|
+
- **`indexer/index_codebase.py`**: Added `_chroma_write_lock` (threading.Lock) around all ChromaDB write operations. Background watcher's `_do_reindex()` and `start_background_full_index()` both acquire this lock — prevents concurrent write corruption.
|
|
82
|
+
- **`start_background_full_index()`** (NEW): Start a full index rebuild in a background daemon thread, used by auto_init.py.
|
|
83
|
+
|
|
84
|
+
### Fixed — HTTP Server Cert Path
|
|
85
|
+
- **`mcp_server/http_server.py`**: Module-level `_CERTS_DIR = Path.home() / ".codevira" / "certs"` replaced with lazy `_certs_dir()` function using `get_global_home()`. Cert file accessors updated to functions `_cert_file()` / `_key_file()`.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## [1.5.2] — 2026-04-03 — HTTP Transport + Claude Desktop Support
|
|
90
|
+
|
|
91
|
+
### Added
|
|
92
|
+
- **HTTP/Streamable transport** (`mcp_server/http_server.py`): New `codevira serve [--port N] [--https] [--host ADDR]` command starts a persistent MCP HTTP server using the MCP Streamable HTTP 2025-03-26 spec. Endpoint: `/mcp`. Health check: `GET /`.
|
|
93
|
+
- **HTTPS with mkcert**: `--https` flag auto-generates trusted localhost certificates to `~/.codevira/certs/` using mkcert. Certs are reused on subsequent runs.
|
|
94
|
+
- **Claude Desktop support**: `claude_desktop_config.json` now documented and auto-injected correctly using `command`+`args` (stdio) format, which is the only format Claude Desktop supports.
|
|
95
|
+
- **Transport decision table**: README, PROTOCOL, and FAQ updated with a clear matrix — which transport to use for each client (Claude Desktop, Claude Code CLI, Cursor, Windsurf, Antigravity).
|
|
96
|
+
- **`NODE_EXTRA_CA_CERTS` setup guide**: FAQ documents the one-time mkcert trust setup required for Claude Code CLI to accept local HTTPS certs.
|
|
97
|
+
|
|
98
|
+
### Fixed
|
|
99
|
+
- `--project-dir` flag now works both before and after the `serve` subcommand (argparse previously rejected it after the subcommand name).
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## [1.5.0] — 2026-04-02 — Zero-Config Global Memory + Deep Graph Intelligence
|
|
104
|
+
|
|
105
|
+
### Added — Zero-Config Init
|
|
106
|
+
- **Auto project detection** (`mcp_server/detect.py`): `codevira init` now requires zero prompts. Language, watched dirs, and file extensions are inferred from project markers (`Cargo.toml`, `go.mod`, `tsconfig.json`, `pyproject.toml`, `package.json`, etc.) across 15 languages.
|
|
107
|
+
- **IDE auto-inject** (`mcp_server/ide_inject.py`): On `init`, automatically writes MCP server config into Claude Code (`.claude/settings.json`), Cursor (`.cursor/mcp.json`), Windsurf (`.windsurf/mcp.json`), and Google Antigravity config — non-destructively, merging with existing entries.
|
|
108
|
+
- **CLI flags**: `--name`, `--language`, `--dirs`, `--ext`, `--no-inject` for overriding auto-detection without interactive prompts.
|
|
109
|
+
|
|
110
|
+
### Added — Cross-Project Global Memory
|
|
111
|
+
- **Global DB** (`indexer/global_db.py`): `~/.codevira/global.db` aggregates preferences and learned rules across all projects. Tables: `projects`, `global_preferences`, `global_rules`.
|
|
112
|
+
- **Global sync** (`mcp_server/global_sync.py`): On server startup, imports global preferences (frequency ≥ 3) and rules (confidence ≥ 0.6) into the current project with 0.8× decay. On session end, exports project-level signals back to global.
|
|
113
|
+
- **`get_global_stats()` in `get_session_context()`**: Single-call context now includes cross-project intelligence count.
|
|
114
|
+
- **Paths** (`mcp_server/paths.py`): `get_global_home()` / `get_global_db_path()` create `~/.codevira/` on first use.
|
|
115
|
+
|
|
116
|
+
### Added — Function-Level Call Graph
|
|
117
|
+
- **`symbols` table** in SQLite: stores functions/classes/methods with name, kind, signature, parameters, return type, start/end line, docstring, visibility.
|
|
118
|
+
- **`call_edges` table** in SQLite: caller → callee relationships with line numbers, resolved at index time.
|
|
119
|
+
- **`add_symbol()`, `add_call_edge()`, `get_callers()`, `get_callees()`, `get_symbols_for_file()`, `find_symbol()`, `find_hotspot_functions()`, `find_high_fan_in()`** — 8 new SQLite methods.
|
|
120
|
+
- **Phase 2/3 indexing** in `graph_generator.py`: After file nodes, populates symbols via `_get_python_symbols_detailed()` (ast.walk with call extraction), then resolves cross-file call edges.
|
|
121
|
+
|
|
122
|
+
### Added — Deep Graph Tools (3 new MCP tools)
|
|
123
|
+
- **`query_graph(file_path, symbol?, query_type)`**: Traverses call graph for `callers`, `callees`, `tests`, `dependents`, or `symbols` — function-level, not just file-level.
|
|
124
|
+
- **`analyze_changes(base_ref?, head_ref?)`**: Function-level risk scoring for every changed file — flags missing tests, counts callers, identifies high-risk changes.
|
|
125
|
+
- **`find_hotspots(threshold?)`**: Finds large functions (>50 lines), high fan-in (>5 callers), high fan-out nodes — complexity heatmap for the codebase.
|
|
126
|
+
|
|
127
|
+
### Added — MCP Workflow Prompts (5 prompts)
|
|
128
|
+
- **`review_changes`**: Staged diff + blast radius + risk score in one prompt.
|
|
129
|
+
- **`debug_issue`**: Symptom → affected files → call chain → hypothesis.
|
|
130
|
+
- **`onboard_session`**: Full project context catch-up for new AI sessions.
|
|
131
|
+
- **`pre_commit_check`**: Test coverage gaps + high-risk functions before commit.
|
|
132
|
+
- **`architecture_overview`**: Module map + hotspots + dependency summary.
|
|
133
|
+
|
|
134
|
+
### Added — Tests
|
|
135
|
+
- **`tests/test_v15_zero_config.py`**: 31 new tests covering auto-detection, IDE inject, global DB, call graph, hotspot detection, MCP prompts, and global sync lifecycle.
|
|
136
|
+
|
|
137
|
+
### Changed
|
|
138
|
+
- **`mcp_server/cli.py`**: Replaced all 4 `input()` calls with `auto_detect_project()`; replaced manual JSON printing with `inject_ide_config()`; registers project in global DB on init.
|
|
139
|
+
- **`mcp_server/server.py`**: Registered 3 new graph tools + 5 MCP prompts via `@server.list_prompts()` / `@server.get_prompt()`; runs `import_global_to_project()` on startup.
|
|
140
|
+
- **`mcp_server/tools/learning.py`**: `get_session_context()` now includes `global_intelligence` stats.
|
|
141
|
+
|
|
142
|
+
### Verified
|
|
143
|
+
- Full tool audit: **36/36** tool dispatches registered (33 tools + 3 new graph tools).
|
|
144
|
+
- MCP prompts: **5/5** registered and resolvable.
|
|
145
|
+
- Unit tests: **101/101** pass (70 existing + 31 new).
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## [1.4.0] — 2026-04-02 — Living Memory: Adaptive Learning & Real Dependency Graph
|
|
150
|
+
|
|
151
|
+
### Added — Dependency Graph (was broken, now works)
|
|
152
|
+
- **Dependency edges wired up**: `extract_imports()` is now called during graph generation, populating the `edges` table via new `add_edge()` / `remove_edges_for_node()` methods. `get_impact()` now returns real blast-radius results (was always empty before).
|
|
153
|
+
- **Tree-sitter import resolution**: Enhanced `_extract_imports_treesitter()` to resolve TypeScript/JS relative imports, Go package imports, and Rust use paths to actual project file paths.
|
|
154
|
+
- **Edge auto-refresh**: Dependency edges are re-derived on every incremental index and live file-watcher trigger — edges stay current within 2 seconds of file save.
|
|
155
|
+
|
|
156
|
+
### Added — Adaptive Learning Engine (7 new MCP tools)
|
|
157
|
+
- **`get_decision_confidence(file_path?, pattern?)`**: Returns outcome-based confidence scores — how often past decisions in an area were kept, modified, or reverted.
|
|
158
|
+
- **`get_preferences(category?)`**: Returns learned developer style preferences (naming, structure, patterns) from post-edit correction signals.
|
|
159
|
+
- **`get_learned_rules(file_path?, category?)`**: Returns auto-generated rules from observed patterns — test pairing, import hotspots, co-change files, recurring decision phrases.
|
|
160
|
+
- **`get_project_maturity()`**: Returns a 0–100 maturity score combining session count, file coverage, confidence, learned rules, and preference signals.
|
|
161
|
+
- **`get_session_context()`**: Single "catch me up" call for cross-tool continuity. Returns current roadmap phase, open changesets, recent decisions with confidence, top preferences, and active rules.
|
|
162
|
+
- **`export_graph(format, scope?)`**: Generates dependency diagrams in Mermaid or DOT format, with stability-based node styling.
|
|
163
|
+
- **`get_graph_diff(base_ref?, head_ref?)`**: Shows which graph nodes changed between git refs, their stability, do_not_revert flags, and union blast radius.
|
|
164
|
+
|
|
165
|
+
### Added — Backend (3 new files)
|
|
166
|
+
- **`indexer/outcome_tracker.py`**: Git-based feedback loop — analyzes post-session git history to classify changes as kept, modified, or reverted. Feeds confidence scoring and preference learning.
|
|
167
|
+
- **`indexer/rule_learner.py`**: Pattern detection engine — infers test pairing rules, import hotspot rules, decision pattern rules, and co-change rules from session history.
|
|
168
|
+
- **`mcp_server/tools/learning.py`**: MCP tool implementations for all 7 learning tools, including maturity scoring and cross-tool session handoff.
|
|
169
|
+
|
|
170
|
+
### Added — SQLite Schema (3 new tables)
|
|
171
|
+
- **`outcomes`**: Tracks kept/modified/reverted outcomes per decision with delta summaries.
|
|
172
|
+
- **`preferences`**: Stores developer style signals with frequency counts and examples.
|
|
173
|
+
- **`learned_rules`**: Auto-generated rules with confidence scores, categories, and file pattern matching.
|
|
174
|
+
|
|
175
|
+
### Changed
|
|
176
|
+
- **`generate_graph_sqlite()`** now returns `edges_added` count alongside `nodes_added` / `nodes_skipped`.
|
|
177
|
+
- **MCP server startup** now runs outcome analysis and rule inference on boot (best-effort, non-blocking).
|
|
178
|
+
|
|
179
|
+
### Verified
|
|
180
|
+
- Full tool audit: **33/33** tool dispatches registered and passing.
|
|
181
|
+
- Unit tests: **70/70** pass (41 existing + 22 new + 7 edge-case).
|
|
182
|
+
- Real codebase validation: 57 dependency edges populated, blast radius returns 27 affected files for core modules.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## [1.3.1] — 2026-03-26 — MCP Tool Dispatch Hotfix
|
|
187
|
+
|
|
188
|
+
### Fixed
|
|
189
|
+
- **`write_session_log` crash**: Simplified from 12 mismatched parameters to 6 clean parameters (`session_id`, `task`, `phase`, `files_changed`, `decisions`, `next_steps`). The MCP schema now expects `decisions` as structured `list[object]` with `{file_path, decision, context}` instead of plain strings. Both `documenter.md` copies updated to match.
|
|
190
|
+
- **`search_codebase` crash**: Server dispatch passed `limit=` and `layer=` but function expects `top_k=` and has no `layer` param. Fixed dispatch to use `top_k=`.
|
|
191
|
+
- **`add_node` crash**: Server dispatch passed `graph_file=` but function doesn't accept it. Removed from dispatch and schema.
|
|
192
|
+
- **`get_history` crash**: Server dispatch passed `n=5` but function only accepts `file_path`. Removed `n` from dispatch and schema.
|
|
193
|
+
- **`refresh_index` crash**: Server dispatch passed `None` via `.get()` but function expects `list[str]`. Added `or []` fallback.
|
|
194
|
+
- **`update_node` crash**: Dispatch was calling `update_node_after_change()` from `changesets.py` which had a **broken import** (`from tools.graph import _load_all_nodes` — function doesn't exist). Switched to SQLite-based `update_node()` from `graph.py`.
|
|
195
|
+
- **Schema accuracy**: Removed `n` parameter from `get_history` schema and `graph_file` parameter from `add_node` schema — these params were advertised to AI agents but never accepted by the backend.
|
|
196
|
+
- **Documentation sync**: Updated both `agents/documenter.md` and `mcp_server/data/agents/documenter.md` to show correct 6-param `write_session_log` usage with structured decisions.
|
|
197
|
+
|
|
198
|
+
### Verified
|
|
199
|
+
- Full dispatch audit: **26/26** tool dispatches pass parameter matching tests.
|
|
200
|
+
- Unit tests: **37/37** pass.
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## [1.3.0] — 2026-03-26 — Persistence Overhaul, Live Auto-Watch & Parser Hardening
|
|
205
|
+
|
|
206
|
+
### Added
|
|
207
|
+
- **Multi-language support expansion**: Added `tree-sitter-language-pack` to seamlessly support AST parsing, `get_signature`, and `get_code` across 14+ languages including Java, C#, Ruby, PHP, and C++.
|
|
208
|
+
- **SQLite Graph Database**: Migrated context graph from `.yaml` files to a single, high-performance `graph.db` SQLite database.
|
|
209
|
+
- **SQLite Memory & Session Logs**: Agent session logs and decisions are now stored directly in the `graph.db` `sessions` and `decisions` tables, deprecating `.md` and `.yaml` log files.
|
|
210
|
+
- **Blast-Radius Analysis**: Upgraded `get_impact` to use recursive CTE SQL queries for lightning-fast dependency tracing.
|
|
211
|
+
- **Hash-based Incremental Indexing**: Replaced modification timestamp checks with `SHA-256` content hashing, allowing the indexer to completely skip unmodified or purely "touched" files.
|
|
212
|
+
- **Live Auto-Watch (Default)**: The MCP server now automatically starts a background file watcher on boot. Source file changes are detected via `watchdog` and the index is incrementally updated after a 2-second debounce window — no manual `codevira index` or git commit needed. CLI `--watch` mode and post-commit hook remain available as alternatives.
|
|
213
|
+
|
|
214
|
+
### Fixed & Hardened (Chaos Testing)
|
|
215
|
+
- **Config Nesting Bug (Critical)**: `_load_config()` now correctly extracts the `project` sub-dict from `config.yaml`, resolving a failure where the indexer fell back to scanning `src/` (non-existent) instead of the configured `watched_dirs`, resulting in 0 chunks indexed.
|
|
216
|
+
- **Chunk Deduplication**: Full rebuild and incremental indexing no longer produce duplicate entries when `watched_dirs` contains overlapping paths (e.g., `"."` alongside `"indexer"`, `"mcp_server"`).
|
|
217
|
+
- **Rust `is_public` Detection**: Fixed a broken comparison (`"pub " in _node_text(node, b"pub ")`) that always returned `False`. Now correctly checks for `visibility_modifier` AST nodes and source text prefix.
|
|
218
|
+
- **Go Struct/Interface Detection**: `type_declaration` nodes now properly traverse `type_spec` children to extract `struct_type` and `interface_type` kinds, which were previously missed entirely.
|
|
219
|
+
- **Rust Import Extraction**: `use_declaration` nodes (e.g., `use std::collections::HashMap`) now extract scoped module paths, not just quoted strings (which only worked for JS/TS).
|
|
220
|
+
- **Stale Test Fixture**: Updated `test_unsupported_language` to use `"brainfuck"` instead of `"java"` since Java is now a supported language via `tree-sitter-language-pack`.
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## [1.2.0] — 2026-03-24 — Language Expansion & Developer Experience
|
|
225
|
+
|
|
226
|
+
### Added
|
|
227
|
+
- **Multi-language support via tree-sitter**: Full AST-based feature parity for **TypeScript**, **Go**, and **Rust** alongside Python.
|
|
228
|
+
- **`indexer/treesitter_parser.py`**: Unified tree-sitter parser foundation with language-specific queries for symbol extraction, import parsing, docstring extraction, and visibility detection.
|
|
229
|
+
- **Multi-language chunking** (`indexer/chunker.py`): `chunk_file()` and `extract_imports()` dispatch to tree-sitter for `.ts`, `.tsx`, `.go`, `.rs` files; Python files continue using stdlib `ast`.
|
|
230
|
+
- **Multi-language code reader** (`mcp_server/tools/code_reader.py`): `get_signature()` and `get_code()` now support all 4 languages — `.py`-only gate removed.
|
|
231
|
+
- **Multi-language graph generation** (`indexer/graph_generator.py`): `generate_graph_node()`, `_get_module_docstring()`, `_get_public_symbols()` dispatch to tree-sitter for non-Python files.
|
|
232
|
+
- **Multi-language playbook rules** (`mcp_server/data/rules/multi-language.md`): Language-specific coding standards for TypeScript, Go, and Rust.
|
|
233
|
+
- **`codevira` CLI entry point**: Consolidated `codevira` commands into a shorter `codevira` global alias for simpler daily use (`codevira init`, `codevira index`, `codevira status`).
|
|
234
|
+
- **Index health dashboard**: the `status` command now displays a highly readable `rich` Table and Panel outlining index statistics, outdated files, and timestamp.
|
|
235
|
+
- **Progress bar for indexing**: Full and incremental `index` commands now display a visual `rich.progress` bar for chunk indexing progress.
|
|
236
|
+
- **Global Installation Support**: Built-in support to run `codevira` from anywhere without virtual environment dependencies, correctly resolving the target `cwd` path instead of strictly `__file__`.
|
|
237
|
+
- **36 tree-sitter parser tests** (`tests/test_treesitter_parser.py`): Comprehensive coverage for all 3 languages.
|
|
238
|
+
- **Test fixtures**: Sample files for TypeScript, Go, and Rust in `tests/fixtures/`.
|
|
239
|
+
|
|
240
|
+
### Changed
|
|
241
|
+
- `iter_source_files()` now reads `file_extensions` from config instead of hardcoding `.py`.
|
|
242
|
+
- `config.example.yaml` updated to document full support for all 4 languages.
|
|
243
|
+
|
|
244
|
+
### Fixed & Hardened (Destructive Testing)
|
|
245
|
+
- **CLI Startup Crash**: Removed an erroneous nested `asyncio.run()` wrapper in `mcp_server/cli.py` that caused fatal `ValueError: a coroutine was expected` crashes when the CLI was executed as a raw MCP server.
|
|
246
|
+
- **AST Relative Import Bug**: Fixed a `NoneType` attribute error in Python AST chunking where relative imports (`from . import x`, level > 0) caused the indexer to fail.
|
|
247
|
+
- **Database Corruption Recovery**: Deep OS-level chaos testing revealed that corrupted ChromaDB files or locked `.codevira` directories leaked raw SQLite stack traces. Added robust interception that outputs formatted, step-by-step shell commands instructing developers how to rebuild the missing database (`rm -rf ... && codevira index --full`), bypassing the panic.
|
|
248
|
+
- **Idempotent Missing State**: Running `codevira index` without an initialized configuration safely warns `No baseline found...` instead of faulting.
|
|
249
|
+
|
|
250
|
+
### Dependencies
|
|
251
|
+
- Added `tree-sitter>=0.23`, `tree-sitter-typescript>=0.23`, `tree-sitter-go>=0.23`, `tree-sitter-rust>=0.23`.
|
|
252
|
+
- Added `rich>=13.0.0` for premium terminal output and formatting.
|
|
253
|
+
|
|
254
|
+
## [1.1.2] — 2026-03-09
|
|
255
|
+
|
|
256
|
+
### Added
|
|
257
|
+
- **Global MCP Client Guide:** Added explicit documentation in `README.md` and `FAQ.md` explaining how to configure uniquely named servers (e.g., `codevira-project-a`) to prevent cross-project roadmap contamination when using global clients like Google Antigravity or Claude Desktop.
|
|
258
|
+
- **Gitignore Safeguard:** Added `.codevira/` to the default project `.gitignore` to prevent auto-generated configuration and database files from being accidentally committed to public repositories.
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## [1.0.0] — 2026-03-06 — Initial Release
|
|
263
|
+
|
|
264
|
+
### Added
|
|
265
|
+
|
|
266
|
+
**Core MCP Server — 26 tools across 5 modules**
|
|
267
|
+
- `get_node`, `get_impact`, `list_nodes`, `add_node`, `update_node`, `refresh_graph`, `refresh_index` — context graph tools
|
|
268
|
+
- `get_roadmap`, `get_full_roadmap`, `get_phase`, `update_next_action`, `update_phase_status`, `add_phase`, `complete_phase`, `defer_phase` — roadmap tools
|
|
269
|
+
- `list_open_changesets`, `get_changeset`, `start_changeset`, `complete_changeset`, `update_changeset_progress` — changeset tools
|
|
270
|
+
- `search_codebase`, `search_decisions`, `get_history`, `write_session_log` — search and session tools
|
|
271
|
+
- `get_signature`, `get_code` — Python AST code reader tools
|
|
272
|
+
- `get_playbook` — curated task rule lookup
|
|
273
|
+
|
|
274
|
+
**Indexer**
|
|
275
|
+
- ChromaDB + sentence-transformers semantic code index
|
|
276
|
+
- Python AST chunker with function/class-level granularity
|
|
277
|
+
- Auto-generated context graph stubs from imports and docstrings
|
|
278
|
+
- Incremental indexing (only changed files since last build)
|
|
279
|
+
- `--full`, `--status`, `--watch`, `--generate-graph`, `--bootstrap-roadmap` CLI flags
|
|
280
|
+
- Config-driven via `.agents/config.yaml` (watched_dirs, language, file_extensions, collection_name)
|
|
281
|
+
|
|
282
|
+
**Agent System**
|
|
283
|
+
- Seven agent persona definitions: Orchestrator, Planner, Developer, Reviewer, Tester, Builder, Documenter
|
|
284
|
+
- Session protocol (`PROTOCOL.md`) with mandatory start/end steps
|
|
285
|
+
- 16 engineering rules files covering coding standards, testing, API design, git governance, and more
|
|
286
|
+
|
|
287
|
+
**Developer Experience**
|
|
288
|
+
- `roadmap.yaml` auto-stub on first `get_roadmap()` call — zero setup required
|
|
289
|
+
- Git post-commit hook for auto-reindex on every commit
|
|
290
|
+
- `config.example.yaml` template for quick project setup
|
|
291
|
+
- Graph node schema reference (`graph/_schema.yaml`)
|
|
292
|
+
|
|
293
|
+
**Documentation**
|
|
294
|
+
- Full README with quickstart, tool reference, agent personas, language support table
|
|
295
|
+
- `PROTOCOL.md` — session protocol for AI agents
|
|
296
|
+
- `FAQ.md` — setup, usage, architecture, and troubleshooting
|
|
297
|
+
- `ROADMAP.md` — public project roadmap with versioned milestones
|
|
298
|
+
- `CONTRIBUTING.md` — contribution guide including AI-assisted workflow
|
|
299
|
+
- `CODE_OF_CONDUCT.md`, `SECURITY.md`
|
|
300
|
+
- GitHub issue templates (bug report, feature request) and PR template
|
|
301
|
+
|
|
302
|
+
**Language Support**
|
|
303
|
+
- Full support: Python (AST chunking, get_signature, get_code, auto graph stubs)
|
|
304
|
+
- Partial support: TypeScript, Go, Rust (regex chunking; all non-AST tools work)
|
codevira-1.6.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sachin Shelke <sachin.worldnet@gmail.com>
|
|
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.
|