codevira 1.6.1__tar.gz → 1.7.1__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 (124) hide show
  1. {codevira-1.6.1 → codevira-1.7.1}/CHANGELOG.md +176 -0
  2. codevira-1.7.1/PKG-INFO +585 -0
  3. codevira-1.7.1/README.md +546 -0
  4. codevira-1.7.1/codevira.egg-info/PKG-INFO +585 -0
  5. {codevira-1.6.1 → codevira-1.7.1}/codevira.egg-info/SOURCES.txt +2 -0
  6. {codevira-1.6.1 → codevira-1.7.1}/codevira.egg-info/requires.txt +2 -4
  7. {codevira-1.6.1/mcp_server/data → codevira-1.7.1}/config.example.yaml +5 -2
  8. {codevira-1.6.1 → codevira-1.7.1}/docs/roadmap.md +20 -13
  9. {codevira-1.6.1 → codevira-1.7.1}/indexer/chunker.py +0 -1
  10. {codevira-1.6.1 → codevira-1.7.1}/indexer/global_db.py +0 -11
  11. {codevira-1.6.1 → codevira-1.7.1}/indexer/graph_generator.py +36 -4
  12. {codevira-1.6.1 → codevira-1.7.1}/indexer/index_codebase.py +128 -27
  13. {codevira-1.6.1 → codevira-1.7.1}/indexer/outcome_tracker.py +0 -13
  14. {codevira-1.6.1 → codevira-1.7.1}/indexer/treesitter_parser.py +1 -4
  15. codevira-1.7.1/mcp_server/__init__.py +17 -0
  16. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/auto_init.py +10 -2
  17. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/cli.py +136 -10
  18. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/crash_logger.py +7 -2
  19. {codevira-1.6.1 → codevira-1.7.1/mcp_server/data}/config.example.yaml +5 -2
  20. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/http_server.py +80 -3
  21. codevira-1.7.1/mcp_server/log_retention.py +171 -0
  22. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/migrate.py +7 -2
  23. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/paths.py +2 -2
  24. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/server.py +147 -36
  25. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/tools/changesets.py +4 -2
  26. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/tools/code_reader.py +0 -1
  27. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/tools/graph.py +210 -71
  28. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/tools/learning.py +76 -70
  29. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/tools/playbook.py +1 -1
  30. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/tools/roadmap.py +32 -25
  31. codevira-1.7.1/mcp_server/tools/search.py +334 -0
  32. {codevira-1.6.1 → codevira-1.7.1}/pyproject.toml +11 -9
  33. {codevira-1.6.1 → codevira-1.7.1}/tests/test_auto_init.py +2 -1
  34. {codevira-1.6.1 → codevira-1.7.1}/tests/test_cli.py +2 -2
  35. {codevira-1.6.1 → codevira-1.7.1}/tests/test_global_db.py +12 -70
  36. {codevira-1.6.1 → codevira-1.7.1}/tests/test_index_codebase.py +2 -2
  37. codevira-1.7.1/tests/test_log_retention.py +249 -0
  38. {codevira-1.6.1 → codevira-1.7.1}/tests/test_migrate.py +8 -4
  39. {codevira-1.6.1 → codevira-1.7.1}/tests/test_outcome_tracker.py +0 -31
  40. {codevira-1.6.1 → codevira-1.7.1}/tests/test_server.py +8 -8
  41. {codevira-1.6.1 → codevira-1.7.1}/tests/test_tools_changesets.py +2 -2
  42. {codevira-1.6.1 → codevira-1.7.1}/tests/test_tools_graph.py +55 -41
  43. {codevira-1.6.1 → codevira-1.7.1}/tests/test_tools_learning.py +20 -28
  44. {codevira-1.6.1 → codevira-1.7.1}/tests/test_tools_roadmap.py +2 -32
  45. {codevira-1.6.1 → codevira-1.7.1}/tests/test_tools_search.py +21 -25
  46. codevira-1.6.1/PKG-INFO +0 -477
  47. codevira-1.6.1/README.md +0 -436
  48. codevira-1.6.1/codevira.egg-info/PKG-INFO +0 -477
  49. codevira-1.6.1/mcp_server/__init__.py +0 -1
  50. codevira-1.6.1/mcp_server/tools/search.py +0 -174
  51. {codevira-1.6.1 → codevira-1.7.1}/LICENSE +0 -0
  52. {codevira-1.6.1 → codevira-1.7.1}/MANIFEST.in +0 -0
  53. {codevira-1.6.1 → codevira-1.7.1}/agents/builder.md +0 -0
  54. {codevira-1.6.1 → codevira-1.7.1}/agents/developer.md +0 -0
  55. {codevira-1.6.1 → codevira-1.7.1}/agents/documenter.md +0 -0
  56. {codevira-1.6.1 → codevira-1.7.1}/agents/orchestrator.md +0 -0
  57. {codevira-1.6.1 → codevira-1.7.1}/agents/planner.md +0 -0
  58. {codevira-1.6.1 → codevira-1.7.1}/agents/reviewer.md +0 -0
  59. {codevira-1.6.1 → codevira-1.7.1}/agents/tester.md +0 -0
  60. {codevira-1.6.1 → codevira-1.7.1}/codevira.egg-info/dependency_links.txt +0 -0
  61. {codevira-1.6.1 → codevira-1.7.1}/codevira.egg-info/entry_points.txt +0 -0
  62. {codevira-1.6.1 → codevira-1.7.1}/codevira.egg-info/top_level.txt +0 -0
  63. {codevira-1.6.1 → codevira-1.7.1}/docs/how-i-built-persistent-memory-for-ai-agents.md +0 -0
  64. {codevira-1.6.1 → codevira-1.7.1}/docs/linkedin-article-ai-agent-memory.md +0 -0
  65. {codevira-1.6.1 → codevira-1.7.1}/docs/linkedin-post-ai-agent-memory.md +0 -0
  66. {codevira-1.6.1 → codevira-1.7.1}/docs/medium-your-ai-coding-agent-has-amnesia.md +0 -0
  67. {codevira-1.6.1 → codevira-1.7.1}/graph/_schema.yaml +0 -0
  68. {codevira-1.6.1 → codevira-1.7.1}/indexer/__init__.py +0 -0
  69. {codevira-1.6.1 → codevira-1.7.1}/indexer/rule_learner.py +0 -0
  70. {codevira-1.6.1 → codevira-1.7.1}/indexer/sqlite_graph.py +0 -0
  71. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/__main__.py +0 -0
  72. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/__init__.py +0 -0
  73. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/agents/builder.md +0 -0
  74. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/agents/developer.md +0 -0
  75. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/agents/documenter.md +0 -0
  76. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/agents/orchestrator.md +0 -0
  77. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/agents/planner.md +0 -0
  78. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/agents/reviewer.md +0 -0
  79. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/agents/tester.md +0 -0
  80. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/rules/coding-standards.md +0 -0
  81. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/rules/engineering-excellence.md +0 -0
  82. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/rules/git-cicd-governance.md +0 -0
  83. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/rules/git_commits.md +0 -0
  84. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/rules/incremental-updates.md +0 -0
  85. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/rules/master_rule.md +0 -0
  86. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/rules/multi-language.md +0 -0
  87. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/rules/persistence.md +0 -0
  88. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/rules/resilience-observability.md +0 -0
  89. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/rules/smoke-testing.md +0 -0
  90. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/data/rules/testing-standards.md +0 -0
  91. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/detect.py +0 -0
  92. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/gitignore.py +0 -0
  93. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/global_sync.py +0 -0
  94. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/ide_inject.py +0 -0
  95. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/launchd.py +0 -0
  96. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/prompts.py +0 -0
  97. {codevira-1.6.1 → codevira-1.7.1}/mcp_server/tools/__init__.py +0 -0
  98. {codevira-1.6.1 → codevira-1.7.1}/rules/coding-standards.md +0 -0
  99. {codevira-1.6.1 → codevira-1.7.1}/rules/engineering-excellence.md +0 -0
  100. {codevira-1.6.1 → codevira-1.7.1}/rules/git-cicd-governance.md +0 -0
  101. {codevira-1.6.1 → codevira-1.7.1}/rules/git_commits.md +0 -0
  102. {codevira-1.6.1 → codevira-1.7.1}/rules/incremental-updates.md +0 -0
  103. {codevira-1.6.1 → codevira-1.7.1}/rules/master_rule.md +0 -0
  104. {codevira-1.6.1 → codevira-1.7.1}/rules/persistence.md +0 -0
  105. {codevira-1.6.1 → codevira-1.7.1}/rules/resilience-observability.md +0 -0
  106. {codevira-1.6.1 → codevira-1.7.1}/rules/smoke-testing.md +0 -0
  107. {codevira-1.6.1 → codevira-1.7.1}/rules/testing-standards.md +0 -0
  108. {codevira-1.6.1 → codevira-1.7.1}/setup.cfg +0 -0
  109. {codevira-1.6.1 → codevira-1.7.1}/tests/test_chunker.py +0 -0
  110. {codevira-1.6.1 → codevira-1.7.1}/tests/test_crash_logger.py +0 -0
  111. {codevira-1.6.1 → codevira-1.7.1}/tests/test_detect.py +0 -0
  112. {codevira-1.6.1 → codevira-1.7.1}/tests/test_gitignore.py +0 -0
  113. {codevira-1.6.1 → codevira-1.7.1}/tests/test_global_sync.py +0 -0
  114. {codevira-1.6.1 → codevira-1.7.1}/tests/test_graph_generator.py +0 -0
  115. {codevira-1.6.1 → codevira-1.7.1}/tests/test_http_server.py +0 -0
  116. {codevira-1.6.1 → codevira-1.7.1}/tests/test_ide_inject.py +0 -0
  117. {codevira-1.6.1 → codevira-1.7.1}/tests/test_launchd.py +0 -0
  118. {codevira-1.6.1 → codevira-1.7.1}/tests/test_paths.py +0 -0
  119. {codevira-1.6.1 → codevira-1.7.1}/tests/test_prompts.py +0 -0
  120. {codevira-1.6.1 → codevira-1.7.1}/tests/test_rule_learner.py +0 -0
  121. {codevira-1.6.1 → codevira-1.7.1}/tests/test_sqlite_graph.py +0 -0
  122. {codevira-1.6.1 → codevira-1.7.1}/tests/test_tools_code_reader.py +0 -0
  123. {codevira-1.6.1 → codevira-1.7.1}/tests/test_tools_playbook.py +0 -0
  124. {codevira-1.6.1 → codevira-1.7.1}/tests/test_treesitter_parser.py +0 -0
@@ -13,6 +13,182 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
13
13
 
14
14
  ---
15
15
 
16
+ ## [1.7.1] — 2026-04-22 — Search Timeout Fix & Version Display
17
+
18
+ Two small but user-visible fixes on top of v1.7.0.
19
+
20
+ ### Fixed
21
+
22
+ - **`search_codebase` timeout on first call** (reported by a user testing
23
+ on Antigravity). The embedding model (`all-MiniLM-L6-v2`) was being
24
+ instantiated fresh on every MCP tool call, which triggered a ~90MB
25
+ download + PyTorch init on first ever use (30-60s on slow networks)
26
+ and 1-3s of re-init overhead on every subsequent call. Antigravity's
27
+ ~30s MCP tool timeout killed the query before the model finished loading.
28
+
29
+ Three-layer fix:
30
+ 1. Module-level cache for the chroma client + embedding function,
31
+ keyed by `db_dir`. Subsequent calls are now instant.
32
+ 2. Background `prewarm_embedding_model()` spawned at server startup
33
+ (both stdio and HTTP transports). Model loads in parallel with
34
+ the MCP handshake window.
35
+ 3. Cold-path timeout guard: if a query arrives while warmup is still
36
+ in progress, returns `{"status": "warming", ...}` within 10 seconds
37
+ instead of blocking until the MCP timeout fires. The agent gets a
38
+ clean retryable response.
39
+
40
+ - **`codevira register` banner showed hardcoded `v1.6`** after upgrading
41
+ to v1.7.0. Now reads `mcp_server.__version__` dynamically. Same fix
42
+ applied to `metadata.json` version field written during auto-init and
43
+ migration.
44
+
45
+ ---
46
+
47
+ ## [1.7.0] — 2026-04-18 — Token Efficiency & AI-First Tool Design
48
+
49
+ **The biggest release since v1.0.** We realized Codevira was dumping 15k-60k
50
+ tokens per session into AI agent context windows — defeating the entire
51
+ "92% token reduction" value prop. This release redesigns tool responses
52
+ around what agents actually need, not what the database can return.
53
+
54
+ ### Changed — Dependency model
55
+ - **`chromadb` + `sentence-transformers` now required** (was `[search]` extra).
56
+ `pip install codevira` installs all 36 MCP tools out of the box.
57
+ Trade-off: ~500MB install (ML runtime) vs. ~50MB. Eliminates the
58
+ "why doesn't semantic search work?" confusion.
59
+ - **`[search]` extra kept as no-op alias** for backwards compatibility.
60
+
61
+ ### Changed — Token-efficient tool responses (the big one)
62
+
63
+ Every high-traffic tool now returns a **summary by default**, with opt-in
64
+ full data. On a 500-node project, a single agent session went from ~60k
65
+ tokens to ~5k.
66
+
67
+ - **`get_session_context`**: Compacted ~4k → ~800 tokens. Dropped
68
+ `global_intelligence`/`indexing_progress` (admin data, not session data).
69
+ Truncated decision/summary text. Nested `current_phase` at top level.
70
+ - **`get_node(path)`**: Default returns counts (`rules_count`,
71
+ `dependencies_count`) + flags. Pass `full=True` for the full arrays.
72
+ Typical response: ~100 tokens (was 500-3000).
73
+ - **`get_impact(path)`**: Default returns 10 affected files + protected/
74
+ high-stability counts. Pass `summary_only=True` for just counts
75
+ (~80 tokens — perfect for gate checks before modifying).
76
+ - **`search_codebase(query)`**: Default returns file/symbol pointers only.
77
+ Pass `include_content=True` to inline chunk source (500-3000 tokens per
78
+ match). `limit` capped at 20.
79
+ - **`search_decisions(query)`**: Default limit 5 (was 10), context truncated
80
+ to 150 chars. Pass `full=True` for untruncated text. `limit` capped at 20.
81
+ - **`get_history(file)`**: Default limit 5 (was 20), text truncated.
82
+ Pass `full=True` for untruncated. `limit` capped at 50.
83
+ - **`get_full_roadmap`**: Completed phases summarized (number + name + date
84
+ + decision_count) instead of inlining all `key_decisions`. Pass
85
+ `include_decisions=true` for the old behavior.
86
+ - **`list_nodes`**: Paginated (50 per page, max 500) with `offset` support.
87
+ Response includes total count + per-layer distribution.
88
+
89
+ ### Changed — AI-facing MCP tool surface trimmed to 23 tools (was 36)
90
+
91
+ 12 tools moved to admin-only — they still work via `call_tool` dispatch
92
+ but are **hidden from `list_tools()`**. AI agents only see tools they
93
+ should use. The hidden tools are either:
94
+ - Dashboard/reporting (human workflows): `get_full_roadmap`,
95
+ `get_project_maturity`, `find_hotspots`, `analyze_changes`, `get_graph_diff`
96
+ - Bulk discovery (replaced by targeted queries): `list_nodes`, `add_node`
97
+ - Background automation (self-managed): `refresh_graph`, `refresh_index`
98
+ - Redundant with session_context: `get_preferences`, `get_learned_rules`
99
+ - Dumps too many tokens: `export_graph` (can be 50k tokens)
100
+
101
+ Admins can still call these via CLI. Prompts like `architecture_overview`
102
+ still reference them server-side.
103
+
104
+ ### Added
105
+ - **Non-blocking `refresh_index`**: Returns in <100ms with
106
+ `{"status": "Refresh started in background"}`. Heavy work (graph regen +
107
+ semantic embedding) runs in a daemon thread. Previously, this hung AI
108
+ agents for minutes on 500+ file projects.
109
+ - **`codevira clean` command**: One-shot removal of all Codevira data, IDE
110
+ configs, and services. `--all`, `--dry-run`, `-y` supported.
111
+ - **Google Antigravity global mode**: `codevira register` now includes
112
+ Antigravity with a single global entry (was missing + wrong config path).
113
+ - **Browser-friendly landing page**: `GET /` on HTTP server returns helpful
114
+ HTML with setup instructions for browsers. API clients still get JSON.
115
+
116
+ ### Fixed
117
+ - **`refresh_graph` ignored its `file_paths` parameter** — dead code that
118
+ always regenerated the entire graph. Cleaned up.
119
+ - **`generate_graph_sqlite` crashed on macOS system paths**: Now skips
120
+ `Library`, `System`, `Applications`, `node_modules`, `.venv`, etc.,
121
+ and catches `OSError`/`ValueError` per-entry so one bad symlink doesn't
122
+ abort indexing.
123
+ - **Crash log test isolation**: `crash_logger._get_log_dir()` now uses
124
+ `get_global_home()`. Tests no longer pollute the real user's crash log.
125
+ - **`_get_embedding_fn` ValueError not caught**: When chromadb is installed
126
+ but sentence-transformers isn't, chromadb raises `ValueError`. Now caught.
127
+ - **Playbook `add_route` → `add_tool`**: The valid task type was renamed
128
+ in code but the description still said `add_route`. Fixed.
129
+ - **Antigravity config path**: Was wrong (`~/.gemini/settings/`). Now uses
130
+ the correct `~/.gemini/antigravity/mcp_config.json`.
131
+
132
+ ### Added — Post-release enhancements (merged into 1.7.0)
133
+
134
+ - **`codevira status` is now fast** (~200ms for uninitialized projects,
135
+ ~1s for initialized). Was ~5-6s because it was loading the ~90MB
136
+ sentence-transformers embedding model just to count chunks. Now uses
137
+ `collection.count()` which doesn't need the embedding function, and
138
+ short-circuits entirely when there's no graph DB yet.
139
+ - **`codevira status --global`** flag shows launchd service state +
140
+ cross-project memory stats in a dedicated panel. Works on both
141
+ initialized and uninitialized projects.
142
+ - **`codevira status --check-stale`** flag opt-in for the slow SHA256
143
+ file-walk (was always-on, made status take 5s+).
144
+ - **`codevira clean --legacy`** — remove `.codevira.migrated/` backup
145
+ directories accumulating across all initialized projects. Shows size
146
+ and confirms before deletion.
147
+ - **`logs.retention_days` actually works now** (was dead config in earlier
148
+ versions). Opt-in only — default 0 keeps sessions/decisions forever.
149
+ Set > 0 for privacy-driven time-bounded history. Runs at most once
150
+ per 24h at server startup.
151
+ - **HTTP/HTTPS transport marked as PREVIEW** (single-project only). The
152
+ server binds to one project at startup and cannot switch contexts per
153
+ request. Multi-project HTTPS routing via MCP `initialize` `rootUri` is
154
+ the top v1.8 priority. `codevira serve` prints a preview warning on
155
+ startup. README / FAQ / PROTOCOL updated to position stdio as the
156
+ clear recommendation for multi-project work.
157
+ - **Dead-code audit** — removed 4 unused functions (`find_project_by_remote`
158
+ in global_db, `get_file_outcome_summary`, `add_open_changeset`,
159
+ `remove_open_changeset`), renamed `get_changeset` → `_get_changeset`
160
+ (was module-private usage only). Wired up 3 unused-but-useful functions
161
+ (`launchd_status`, `cleanup_legacy_dir`, `get_global_stats`) into the
162
+ CLI where they belong.
163
+ - **Open-source readiness pass** — removed stray test-playground files
164
+ from git, fixed PR template typo (`mcp-server` → `mcp_server`), replaced
165
+ hardcoded author username in docstring examples (`/Users/sachin/...`
166
+ → `/Users/alice/...`), added `__all__` + `__version__` to
167
+ `mcp_server/__init__.py`, removed duplicate `requirements.txt`.
168
+
169
+ ### Tests
170
+ - 1,306 tests passing (added 15 new tests for `log_retention.py`)
171
+
172
+ ---
173
+
174
+ ## [1.6.2] — 2026-04-16 — Crash Log Isolation & Browser UX
175
+
176
+ ### Fixed
177
+ - **Crash log test isolation**: `crash_logger._get_log_dir()` now uses
178
+ `get_global_home()` instead of hardcoding `~/.codevira/logs/`. Tests
179
+ no longer pollute the real user's crash log with pytest mock tracebacks.
180
+ - **`_get_embedding_fn` ValueError not caught**: When chromadb is installed
181
+ but sentence-transformers isn't, chromadb wraps the ImportError as a
182
+ ValueError. `_get_embedding_fn` now catches both and re-raises as
183
+ ImportError for consistent handling by callers.
184
+
185
+ ### Added
186
+ - **Browser-friendly landing page**: `GET /` on the HTTP server now returns
187
+ a helpful HTML page for browsers (with setup instructions) instead of
188
+ just JSON. API clients with `Accept: application/json` still get JSON.
189
+
190
+ ---
191
+
16
192
  ## [1.6.1] — 2026-04-16 — Stability, Graceful Degradation & Cleanup
17
193
 
18
194
  ### Added