codevira 3.7.1__tar.gz → 4.0.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 (455) hide show
  1. {codevira-3.7.1 → codevira-4.0.0}/CHANGELOG.md +440 -0
  2. codevira-4.0.0/MANIFEST.in +25 -0
  3. {codevira-3.7.1/codevira.egg-info → codevira-4.0.0}/PKG-INFO +86 -41
  4. {codevira-3.7.1 → codevira-4.0.0}/README.md +79 -37
  5. {codevira-3.7.1 → codevira-4.0.0/codevira.egg-info}/PKG-INFO +86 -41
  6. {codevira-3.7.1 → codevira-4.0.0}/codevira.egg-info/SOURCES.txt +121 -34
  7. {codevira-3.7.1 → codevira-4.0.0}/codevira.egg-info/requires.txt +7 -3
  8. {codevira-3.7.1 → codevira-4.0.0}/docs/architecture.md +1 -1
  9. codevira-4.0.0/docs/internal/4.0-beta.md +252 -0
  10. codevira-4.0.0/docs/internal/architecture-4.0.md +263 -0
  11. codevira-4.0.0/docs/internal/memory-strategy-2026-07.md +195 -0
  12. {codevira-3.7.1 → codevira-4.0.0}/docs/troubleshooting/config-hygiene.md +1 -1
  13. {codevira-3.7.1 → codevira-4.0.0}/docs/vs-other-memory-tools.md +3 -3
  14. {codevira-3.7.1 → codevira-4.0.0}/indexer/chunker.py +169 -17
  15. codevira-4.0.0/indexer/global_db.py +537 -0
  16. {codevira-3.7.1 → codevira-4.0.0}/indexer/index_codebase.py +28 -4
  17. {codevira-3.7.1 → codevira-4.0.0}/indexer/outcome_classifier.py +1 -1
  18. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/__init__.py +2 -2
  19. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/auto_init.py +42 -14
  20. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/cli.py +233 -132
  21. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/cli_eval.py +0 -38
  22. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/cli_graph.py +6 -14
  23. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/cli_init.py +1 -1
  24. codevira-4.0.0/mcp_server/cli_memory.py +210 -0
  25. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/cli_search.py +51 -6
  26. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/cli_uninstall.py +11 -4
  27. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/doctor.py +100 -5
  28. codevira-4.0.0/mcp_server/egress.py +173 -0
  29. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/__init__.py +0 -2
  30. codevira-4.0.0/mcp_server/engine/audit.py +170 -0
  31. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/events.py +2 -1
  32. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/memory_fanout.py +36 -1
  33. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/policies/__init__.py +0 -2
  34. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/policies/decision_lock.py +69 -10
  35. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/policies/relevance_inject.py +72 -49
  36. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/policies/session_log_enforcer.py +23 -8
  37. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/runner.py +36 -1
  38. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/signals.py +22 -3
  39. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/wiring/claude_code_hooks.py +37 -0
  40. codevira-4.0.0/mcp_server/engine/wiring/git_hooks.py +321 -0
  41. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/http_server.py +9 -23
  42. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/ide_inject.py +196 -99
  43. codevira-4.0.0/mcp_server/memory_undo.py +340 -0
  44. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/migrate.py +102 -1
  45. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/opt_in.py +0 -15
  46. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/paths.py +36 -1
  47. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/project_binding.py +2 -2
  48. codevira-4.0.0/mcp_server/register_all.py +376 -0
  49. codevira-4.0.0/mcp_server/retrieval/__init__.py +41 -0
  50. codevira-4.0.0/mcp_server/retrieval/score.py +130 -0
  51. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/server.py +141 -413
  52. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/setup_wizard.py +9 -14
  53. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/activity_store.py +27 -7
  54. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/agents_md_generator.py +3 -3
  55. codevira-4.0.0/mcp_server/storage/anchor.py +216 -0
  56. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/decisions_store.py +371 -71
  57. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/digest.py +21 -1
  58. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/fts5_index.py +32 -1
  59. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/id_repair.py +145 -14
  60. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/jsonl_store.py +28 -2
  61. codevira-4.0.0/mcp_server/storage/origin.py +281 -0
  62. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/outcomes_writer.py +1 -1
  63. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/paths.py +59 -4
  64. codevira-4.0.0/mcp_server/storage/sanitize.py +92 -0
  65. codevira-4.0.0/mcp_server/storage/text.py +48 -0
  66. codevira-4.0.0/mcp_server/storage/uid.py +101 -0
  67. codevira-4.0.0/mcp_server/tenant.py +78 -0
  68. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/tools/graph.py +53 -13
  69. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/tools/learning.py +8 -48
  70. codevira-4.0.0/mcp_server/tools/provenance.py +33 -0
  71. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/tools/search.py +18 -0
  72. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/tools/working.py +125 -10
  73. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/update_check.py +67 -24
  74. {codevira-3.7.1 → codevira-4.0.0}/pyproject.toml +41 -4
  75. codevira-4.0.0/tests/conftest.py +572 -0
  76. codevira-4.0.0/tests/e2e/__init__.py +0 -0
  77. codevira-4.0.0/tests/e2e/fixtures/code_only_python/README.md +8 -0
  78. codevira-4.0.0/tests/e2e/fixtures/code_only_python/pyproject.toml +9 -0
  79. codevira-4.0.0/tests/e2e/fixtures/code_only_python/src/widgets.py +25 -0
  80. codevira-4.0.0/tests/e2e/fixtures/code_only_python/tests/test_widgets.py +23 -0
  81. codevira-4.0.0/tests/e2e/fixtures/conftest.py +33 -0
  82. codevira-4.0.0/tests/e2e/fixtures/docs_only/CONTRIBUTING.md +11 -0
  83. codevira-4.0.0/tests/e2e/fixtures/docs_only/README.md +30 -0
  84. codevira-4.0.0/tests/e2e/fixtures/docs_only/docs/architecture.md +9 -0
  85. codevira-4.0.0/tests/e2e/fixtures/docs_only/package.json +6 -0
  86. codevira-4.0.0/tests/e2e/fixtures/monorepo/README.md +6 -0
  87. codevira-4.0.0/tests/e2e/fixtures/monorepo/package.json +6 -0
  88. codevira-4.0.0/tests/e2e/fixtures/monorepo/packages/foo/package.json +5 -0
  89. codevira-4.0.0/tests/e2e/fixtures/monorepo/packages/foo/src/index.ts +4 -0
  90. codevira-4.0.0/tests/e2e/fixtures/polyglot/CLAUDE.md +5 -0
  91. codevira-4.0.0/tests/e2e/fixtures/polyglot/README.md +6 -0
  92. codevira-4.0.0/tests/e2e/fixtures/polyglot/config/settings.yaml +6 -0
  93. codevira-4.0.0/tests/e2e/fixtures/polyglot/pyproject.toml +8 -0
  94. codevira-4.0.0/tests/e2e/fixtures/polyglot/src/api.py +8 -0
  95. codevira-4.0.0/tests/e2e/fixtures/polyglot/src/client.ts +9 -0
  96. codevira-4.0.0/tests/e2e/test_cross_tool_universality.py +372 -0
  97. codevira-4.0.0/tests/e2e/test_first_contact.py +562 -0
  98. codevira-4.0.0/tests/e2e/test_product_invariants.py +308 -0
  99. codevira-4.0.0/tests/e2e/test_qa_round_v2_completion.py +343 -0
  100. codevira-4.0.0/tests/e2e/test_v2_release_candidate.py +1022 -0
  101. codevira-4.0.0/tests/e2e/test_v350_acceptance.py +508 -0
  102. codevira-4.0.0/tests/engine/__init__.py +0 -0
  103. codevira-4.0.0/tests/engine/test_anti_regression.py +806 -0
  104. codevira-4.0.0/tests/engine/test_antigravity_hooks.py +198 -0
  105. codevira-4.0.0/tests/engine/test_audit.py +163 -0
  106. codevira-4.0.0/tests/engine/test_blast_radius.py +900 -0
  107. codevira-4.0.0/tests/engine/test_block_message_evidence.py +106 -0
  108. codevira-4.0.0/tests/engine/test_claude_native_memory.py +76 -0
  109. codevira-4.0.0/tests/engine/test_decision_lock.py +1251 -0
  110. codevira-4.0.0/tests/engine/test_decision_replay.py +746 -0
  111. codevira-4.0.0/tests/engine/test_diff_envelope.py +395 -0
  112. codevira-4.0.0/tests/engine/test_events.py +87 -0
  113. codevira-4.0.0/tests/engine/test_evidence_reaches_readers.py +185 -0
  114. codevira-4.0.0/tests/engine/test_fix_history.py +109 -0
  115. codevira-4.0.0/tests/engine/test_git_hook_enforcement.py +269 -0
  116. codevira-4.0.0/tests/engine/test_integration.py +240 -0
  117. codevira-4.0.0/tests/engine/test_memory_fanout.py +500 -0
  118. codevira-4.0.0/tests/engine/test_policies.py +81 -0
  119. codevira-4.0.0/tests/engine/test_qa_p0_fixes.py +508 -0
  120. codevira-4.0.0/tests/engine/test_qa_round3.py +258 -0
  121. codevira-4.0.0/tests/engine/test_qa_round4.py +281 -0
  122. codevira-4.0.0/tests/engine/test_qa_round5.py +453 -0
  123. codevira-4.0.0/tests/engine/test_qa_round_week13.py +425 -0
  124. codevira-4.0.0/tests/engine/test_region_detect.py +127 -0
  125. codevira-4.0.0/tests/engine/test_relevance_inject.py +434 -0
  126. codevira-4.0.0/tests/engine/test_runner.py +266 -0
  127. codevira-4.0.0/tests/engine/test_session_log_enforcer.py +689 -0
  128. codevira-4.0.0/tests/engine/test_signals_project_scoping.py +185 -0
  129. codevira-4.0.0/tests/engine/test_token_budget.py +489 -0
  130. codevira-4.0.0/tests/engine/test_token_meter.py +120 -0
  131. codevira-4.0.0/tests/engine/test_week2_edge_cases.py +744 -0
  132. codevira-4.0.0/tests/integration/__init__.py +0 -0
  133. codevira-4.0.0/tests/integration/test_help_text_consistency.py +346 -0
  134. codevira-4.0.0/tests/integration/test_mcp_roundtrip.py +503 -0
  135. codevira-4.0.0/tests/integration/test_sandboxed_parent.py +956 -0
  136. codevira-4.0.0/tests/storage/__init__.py +1 -0
  137. codevira-4.0.0/tests/storage/test_activity_store.py +427 -0
  138. codevira-4.0.0/tests/storage/test_agents_md_generator.py +356 -0
  139. codevira-4.0.0/tests/storage/test_amendment_provenance.py +220 -0
  140. codevira-4.0.0/tests/storage/test_anchor_derivation.py +251 -0
  141. codevira-4.0.0/tests/storage/test_atomic.py +180 -0
  142. codevira-4.0.0/tests/storage/test_concurrent_writes.py +341 -0
  143. codevira-4.0.0/tests/storage/test_cross_process_writes.py +199 -0
  144. codevira-4.0.0/tests/storage/test_decisions_store.py +543 -0
  145. codevira-4.0.0/tests/storage/test_device_identity.py +290 -0
  146. codevira-4.0.0/tests/storage/test_digest.py +209 -0
  147. codevira-4.0.0/tests/storage/test_fts5_index.py +293 -0
  148. codevira-4.0.0/tests/storage/test_id_repair_references.py +214 -0
  149. codevira-4.0.0/tests/storage/test_jsonl_store.py +582 -0
  150. codevira-4.0.0/tests/storage/test_manifest.py +185 -0
  151. codevira-4.0.0/tests/storage/test_origin.py +276 -0
  152. codevira-4.0.0/tests/storage/test_sanitize.py +73 -0
  153. codevira-4.0.0/tests/storage/test_score_breakdown.py +83 -0
  154. codevira-4.0.0/tests/storage/test_search_perf_caches.py +215 -0
  155. codevira-4.0.0/tests/storage/test_session_identity.py +131 -0
  156. codevira-4.0.0/tests/storage/test_skills_store.py +822 -0
  157. codevira-4.0.0/tests/storage/test_stranded_parameters.py +116 -0
  158. codevira-4.0.0/tests/storage/test_token_estimator.py +143 -0
  159. codevira-4.0.0/tests/storage/test_uid.py +186 -0
  160. codevira-4.0.0/tests/storage/test_uid_edges.py +256 -0
  161. codevira-4.0.0/tests/storage/test_working_store.py +487 -0
  162. {codevira-3.7.1 → codevira-4.0.0}/tests/test_auto_init.py +108 -0
  163. codevira-4.0.0/tests/test_binding_conflict_detection.py +207 -0
  164. {codevira-3.7.1 → codevira-4.0.0}/tests/test_binding_e2e.py +9 -0
  165. {codevira-3.7.1 → codevira-4.0.0}/tests/test_chunker.py +95 -0
  166. {codevira-3.7.1 → codevira-4.0.0}/tests/test_claude_binding_conflict.py +72 -0
  167. {codevira-3.7.1 → codevira-4.0.0}/tests/test_cli_search.py +92 -5
  168. {codevira-3.7.1 → codevira-4.0.0}/tests/test_doctor.py +34 -0
  169. codevira-4.0.0/tests/test_egress_boundary.py +273 -0
  170. codevira-4.0.0/tests/test_g3_hermetic.py +137 -0
  171. codevira-4.0.0/tests/test_global_home_isolation.py +154 -0
  172. codevira-4.0.0/tests/test_graph_not_indexed_contract.py +157 -0
  173. {codevira-3.7.1 → codevira-4.0.0}/tests/test_http_server.py +28 -11
  174. {codevira-3.7.1 → codevira-4.0.0}/tests/test_ide_inject.py +161 -105
  175. {codevira-3.7.1 → codevira-4.0.0}/tests/test_index_codebase.py +149 -100
  176. {codevira-3.7.1 → codevira-4.0.0}/tests/test_managed_files_e4.py +0 -20
  177. codevira-4.0.0/tests/test_memory_undo.py +298 -0
  178. codevira-4.0.0/tests/test_outcome_reconcile_p17.py +61 -0
  179. codevira-4.0.0/tests/test_pre_release_block_hook.py +319 -0
  180. codevira-4.0.0/tests/test_prune_and_clean_deprecation.py +151 -0
  181. {codevira-3.7.1 → codevira-4.0.0}/tests/test_reconcile.py +12 -6
  182. codevira-4.0.0/tests/test_register_all.py +322 -0
  183. codevira-4.0.0/tests/test_removed_tool_migration.py +88 -0
  184. codevira-4.0.0/tests/test_retrieval_score.py +157 -0
  185. codevira-4.0.0/tests/test_sdist_completeness.py +114 -0
  186. {codevira-3.7.1 → codevira-4.0.0}/tests/test_server.py +19 -34
  187. {codevira-3.7.1 → codevira-4.0.0}/tests/test_setup_wizard.py +74 -4
  188. codevira-4.0.0/tests/test_skill_reinforcement.py +239 -0
  189. codevira-4.0.0/tests/test_subprocess_imports_working_tree.py +103 -0
  190. codevira-4.0.0/tests/test_tenant_isolation.py +297 -0
  191. {codevira-3.7.1 → codevira-4.0.0}/tests/test_tools_graph.py +41 -0
  192. {codevira-3.7.1 → codevira-4.0.0}/tests/test_tools_learning.py +7 -139
  193. {codevira-3.7.1 → codevira-4.0.0}/tests/test_tools_working.py +11 -4
  194. {codevira-3.7.1 → codevira-4.0.0}/tests/test_treesitter_parser.py +54 -4
  195. {codevira-3.7.1 → codevira-4.0.0}/tests/test_update_check.py +38 -0
  196. codevira-4.0.0/tests/test_working_promote_skill.py +165 -0
  197. codevira-4.0.0/tests/test_worktree_shared_memory.py +152 -0
  198. codevira-3.7.1/MANIFEST.in +0 -8
  199. codevira-3.7.1/indexer/global_db.py +0 -293
  200. codevira-3.7.1/indexer/outcome_tracker.py +0 -281
  201. codevira-3.7.1/mcp_server/cli_consensus.py +0 -55
  202. codevira-3.7.1/mcp_server/cli_reflect.py +0 -180
  203. codevira-3.7.1/mcp_server/data/affordances.yaml +0 -44
  204. codevira-3.7.1/mcp_server/data/prompts/reflection_v1.md +0 -40
  205. codevira-3.7.1/mcp_server/engine/policies/prompt_capture.py +0 -255
  206. codevira-3.7.1/mcp_server/eval/composite.py +0 -128
  207. codevira-3.7.1/mcp_server/eval/weight_tuner.py +0 -109
  208. codevira-3.7.1/mcp_server/ingest/__init__.py +0 -30
  209. codevira-3.7.1/mcp_server/ingest/claude_code.py +0 -163
  210. codevira-3.7.1/mcp_server/ingest/codex.py +0 -160
  211. codevira-3.7.1/mcp_server/ingest/gemini.py +0 -148
  212. codevira-3.7.1/mcp_server/ingest/heuristics.py +0 -117
  213. codevira-3.7.1/mcp_server/ingest/models.py +0 -79
  214. codevira-3.7.1/mcp_server/ingest/scan.py +0 -95
  215. codevira-3.7.1/mcp_server/storage/consensus_store.py +0 -625
  216. codevira-3.7.1/mcp_server/storage/learned_weights.py +0 -86
  217. codevira-3.7.1/mcp_server/storage/origin.py +0 -130
  218. codevira-3.7.1/mcp_server/storage/reflections_store.py +0 -387
  219. codevira-3.7.1/mcp_server/storage/sanitize.py +0 -44
  220. codevira-3.7.1/mcp_server/tools/changesets.py +0 -50
  221. codevira-3.7.1/mcp_server/tools/code_reader.py +0 -374
  222. codevira-3.7.1/mcp_server/tools/consensus.py +0 -138
  223. codevira-3.7.1/mcp_server/tools/preferences.py +0 -278
  224. codevira-3.7.1/mcp_server/tools/reflections.py +0 -249
  225. codevira-3.7.1/mcp_server/tools/spatial.py +0 -521
  226. codevira-3.7.1/tests/test_cli_consensus.py +0 -426
  227. codevira-3.7.1/tests/test_consensus_handshake.py +0 -585
  228. codevira-3.7.1/tests/test_ingest_e2.py +0 -350
  229. codevira-3.7.1/tests/test_outcome_reconcile_p17.py +0 -106
  230. codevira-3.7.1/tests/test_outcome_tracker.py +0 -440
  231. codevira-3.7.1/tests/test_preferences_tools.py +0 -207
  232. codevira-3.7.1/tests/test_reflections.py +0 -994
  233. codevira-3.7.1/tests/test_tools_code_reader.py +0 -821
  234. codevira-3.7.1/tests/test_tools_spatial.py +0 -608
  235. codevira-3.7.1/tests/test_weight_tuning_p13.py +0 -195
  236. {codevira-3.7.1 → codevira-4.0.0}/LICENSE +0 -0
  237. {codevira-3.7.1 → codevira-4.0.0}/agents/qa/01-code-review.md +0 -0
  238. {codevira-3.7.1 → codevira-4.0.0}/agents/qa/02-adversarial-fix-review.md +0 -0
  239. {codevira-3.7.1 → codevira-4.0.0}/agents/qa/03-cross-module-impact.md +0 -0
  240. {codevira-3.7.1 → codevira-4.0.0}/agents/qa/06-doc-drift.md +0 -0
  241. {codevira-3.7.1 → codevira-4.0.0}/agents/qa/07-security-audit.md +0 -0
  242. {codevira-3.7.1 → codevira-4.0.0}/agents/qa/12-llm-redteam.md +0 -0
  243. {codevira-3.7.1 → codevira-4.0.0}/agents/qa/13-multi-ide-schema.md +0 -0
  244. {codevira-3.7.1 → codevira-4.0.0}/agents/qa/22-competitor-benchmark.md +0 -0
  245. {codevira-3.7.1 → codevira-4.0.0}/agents/qa/README.md +0 -0
  246. {codevira-3.7.1 → codevira-4.0.0}/agents/qa/tier2-scripts.md +0 -0
  247. {codevira-3.7.1 → codevira-4.0.0}/agents/qa/tier3-manual.md +0 -0
  248. {codevira-3.7.1 → codevira-4.0.0}/codevira.egg-info/dependency_links.txt +0 -0
  249. {codevira-3.7.1 → codevira-4.0.0}/codevira.egg-info/entry_points.txt +0 -0
  250. {codevira-3.7.1 → codevira-4.0.0}/codevira.egg-info/top_level.txt +0 -0
  251. {codevira-3.7.1 → codevira-4.0.0}/config.example.yaml +0 -0
  252. {codevira-3.7.1 → codevira-4.0.0}/docs/alpha-tester-invites.md +0 -0
  253. {codevira-3.7.1 → codevira-4.0.0}/docs/audit-2026-05-22.md +0 -0
  254. {codevira-3.7.1 → codevira-4.0.0}/docs/demo/README.md +0 -0
  255. {codevira-3.7.1 → codevira-4.0.0}/docs/foolproof-product-charter.md +0 -0
  256. {codevira-3.7.1 → codevira-4.0.0}/docs/heroes/00-engine.md +0 -0
  257. {codevira-3.7.1 → codevira-4.0.0}/docs/heroes/01-decision-lock.md +0 -0
  258. {codevira-3.7.1 → codevira-4.0.0}/docs/heroes/02-anti-regression.md +0 -0
  259. {codevira-3.7.1 → codevira-4.0.0}/docs/heroes/03-scope-contract.md +0 -0
  260. {codevira-3.7.1 → codevira-4.0.0}/docs/heroes/04-blast-radius.md +0 -0
  261. {codevira-3.7.1 → codevira-4.0.0}/docs/heroes/05-cross-session.md +0 -0
  262. {codevira-3.7.1 → codevira-4.0.0}/docs/heroes/06-token-budget.md +0 -0
  263. {codevira-3.7.1 → codevira-4.0.0}/docs/heroes/07-live-style.md +0 -0
  264. {codevira-3.7.1 → codevira-4.0.0}/docs/heroes/08-decision-replay.md +0 -0
  265. {codevira-3.7.1 → codevira-4.0.0}/docs/heroes/09-intent-inference.md +0 -0
  266. {codevira-3.7.1 → codevira-4.0.0}/docs/heroes/10-ai-promotion.md +0 -0
  267. {codevira-3.7.1 → codevira-4.0.0}/docs/heroes/README.md +0 -0
  268. {codevira-3.7.1 → codevira-4.0.0}/docs/heroes/pillar-1-setup.md +0 -0
  269. {codevira-3.7.1 → codevira-4.0.0}/docs/hn-launch-day.md +0 -0
  270. {codevira-3.7.1 → codevira-4.0.0}/docs/how-i-built-persistent-memory-for-ai-agents.md +0 -0
  271. {codevira-3.7.1 → codevira-4.0.0}/docs/internal/competitive-landscape.md +0 -0
  272. {codevira-3.7.1 → codevira-4.0.0}/docs/linkedin-article-ai-agent-memory.md +0 -0
  273. {codevira-3.7.1 → codevira-4.0.0}/docs/linkedin-post-ai-agent-memory.md +0 -0
  274. {codevira-3.7.1 → codevira-4.0.0}/docs/local-pypi-https.md +0 -0
  275. {codevira-3.7.1 → codevira-4.0.0}/docs/medium-your-ai-coding-agent-has-amnesia.md +0 -0
  276. {codevira-3.7.1 → codevira-4.0.0}/docs/morning-handoff-2026-05-22.md +0 -0
  277. {codevira-3.7.1 → codevira-4.0.0}/docs/plans/opt-in-activation.md +0 -0
  278. {codevira-3.7.1 → codevira-4.0.0}/docs/plans/v2.1.2.md +0 -0
  279. {codevira-3.7.1 → codevira-4.0.0}/docs/plans/v2.1.3.md +0 -0
  280. {codevira-3.7.1 → codevira-4.0.0}/docs/plans/v2.2.0.md +0 -0
  281. {codevira-3.7.1 → codevira-4.0.0}/docs/plans/v3.0.0.md +0 -0
  282. {codevira-3.7.1 → codevira-4.0.0}/docs/qa-playbook.md +0 -0
  283. {codevira-3.7.1 → codevira-4.0.0}/docs/release-notes/v3.1.1.md +0 -0
  284. {codevira-3.7.1 → codevira-4.0.0}/docs/release-notes/v3.7.1.md +0 -0
  285. {codevira-3.7.1 → codevira-4.0.0}/docs/release-process.md +0 -0
  286. {codevira-3.7.1 → codevira-4.0.0}/docs/roadmap.md +0 -0
  287. {codevira-3.7.1 → codevira-4.0.0}/docs/surface-cuts-2026-05-22.md +0 -0
  288. {codevira-3.7.1 → codevira-4.0.0}/docs/troubleshooting/antigravity.md +0 -0
  289. {codevira-3.7.1 → codevira-4.0.0}/docs/v2-completion-plan.md +0 -0
  290. {codevira-3.7.1 → codevira-4.0.0}/docs/v2-execution-log.md +0 -0
  291. {codevira-3.7.1 → codevira-4.0.0}/docs/v2-master-plan.md +0 -0
  292. {codevira-3.7.1 → codevira-4.0.0}/graph/_schema.yaml +0 -0
  293. {codevira-3.7.1 → codevira-4.0.0}/indexer/__init__.py +0 -0
  294. {codevira-3.7.1 → codevira-4.0.0}/indexer/_dedupe_migration.py +0 -0
  295. {codevira-3.7.1 → codevira-4.0.0}/indexer/_fork_safety.py +0 -0
  296. {codevira-3.7.1 → codevira-4.0.0}/indexer/_sqlite_util.py +0 -0
  297. {codevira-3.7.1 → codevira-4.0.0}/indexer/fix_history.py +0 -0
  298. {codevira-3.7.1 → codevira-4.0.0}/indexer/graph_generator.py +0 -0
  299. {codevira-3.7.1 → codevira-4.0.0}/indexer/sqlite_graph.py +0 -0
  300. {codevira-3.7.1 → codevira-4.0.0}/indexer/treesitter_parser.py +0 -0
  301. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/__main__.py +0 -0
  302. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/_ghost_check.py +0 -0
  303. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/_mcp_registry.py +0 -0
  304. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/_project_inventory.py +0 -0
  305. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/_prompts.py +0 -0
  306. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/_repair_init.py +0 -0
  307. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/_safe_crash.py +0 -0
  308. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/cli_export.py +0 -0
  309. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/cli_hooks_admin.py +0 -0
  310. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/cli_induce.py +0 -0
  311. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/cli_projects.py +0 -0
  312. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/cli_repair.py +0 -0
  313. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/cli_replay.py +0 -0
  314. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/cli_sync.py +0 -0
  315. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/cli_transfer.py +0 -0
  316. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/cli_working.py +0 -0
  317. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/crash_logger.py +0 -0
  318. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/__init__.py +0 -0
  319. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/config.example.yaml +0 -0
  320. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/hooks/post_tool_use.sh +0 -0
  321. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/hooks/pre_tool_use.sh +0 -0
  322. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/hooks/session_start.sh +0 -0
  323. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/hooks/stop.sh +0 -0
  324. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/hooks/user_prompt_submit.sh +0 -0
  325. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/rules/coding-standards-generic.md +0 -0
  326. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/rules/coding-standards-go.md +0 -0
  327. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/rules/coding-standards-typescript.md +0 -0
  328. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/rules/coding-standards.md +0 -0
  329. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/rules/engineering-excellence.md +0 -0
  330. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/rules/git-cicd-governance.md +0 -0
  331. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/rules/git_commits.md +0 -0
  332. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/rules/incremental-updates.md +0 -0
  333. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/rules/master_rule.md +0 -0
  334. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/rules/multi-language.md +0 -0
  335. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/rules/persistence.md +0 -0
  336. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/rules/resilience-observability.md +0 -0
  337. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/rules/smoke-testing.md +0 -0
  338. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/data/rules/testing-standards.md +0 -0
  339. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/decision_replay.py +0 -0
  340. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/detect.py +0 -0
  341. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/demo_policy.py +0 -0
  342. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/policies/_region_detect.py +0 -0
  343. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/policies/_signature_detect.py +0 -0
  344. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/policies/anti_regression.py +0 -0
  345. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/policies/blast_radius.py +0 -0
  346. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/policies/post_edit_refresh.py +0 -0
  347. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/policies/token_budget.py +0 -0
  348. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/policy.py +0 -0
  349. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/token_meter.py +0 -0
  350. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/wiring/__init__.py +0 -0
  351. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/wiring/_diff_envelope.py +0 -0
  352. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/wiring/antigravity_hooks.py +0 -0
  353. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/engine/wiring/mcp_dispatch.py +0 -0
  354. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/eval/__init__.py +0 -0
  355. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/eval/judge.py +0 -0
  356. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/eval/relevance.py +0 -0
  357. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/eval/report.py +0 -0
  358. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/gitignore.py +0 -0
  359. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/global_sync.py +0 -0
  360. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/graph/__init__.py +0 -0
  361. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/graph/template.html +0 -0
  362. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/launchd.py +0 -0
  363. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/log_retention.py +0 -0
  364. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/prompts.py +0 -0
  365. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/roadmap_drift.py +0 -0
  366. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/__init__.py +0 -0
  367. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/atomic.py +0 -0
  368. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/config.py +0 -0
  369. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/manifest.py +0 -0
  370. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/reconcile.py +0 -0
  371. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/sessions_store.py +0 -0
  372. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/skills_store.py +0 -0
  373. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/synonyms.py +0 -0
  374. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/token_estimator.py +0 -0
  375. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/storage/working_store.py +0 -0
  376. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/tools/__init__.py +0 -0
  377. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/tools/check_conflict.py +0 -0
  378. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/tools/playbook.py +0 -0
  379. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/tools/roadmap.py +0 -0
  380. {codevira-3.7.1 → codevira-4.0.0}/mcp_server/tools/skills.py +0 -0
  381. {codevira-3.7.1 → codevira-4.0.0}/rules/coding-standards.md +0 -0
  382. {codevira-3.7.1 → codevira-4.0.0}/rules/engineering-excellence.md +0 -0
  383. {codevira-3.7.1 → codevira-4.0.0}/rules/git-cicd-governance.md +0 -0
  384. {codevira-3.7.1 → codevira-4.0.0}/rules/git_commits.md +0 -0
  385. {codevira-3.7.1 → codevira-4.0.0}/rules/incremental-updates.md +0 -0
  386. {codevira-3.7.1 → codevira-4.0.0}/rules/master_rule.md +0 -0
  387. {codevira-3.7.1 → codevira-4.0.0}/rules/persistence.md +0 -0
  388. {codevira-3.7.1 → codevira-4.0.0}/rules/resilience-observability.md +0 -0
  389. {codevira-3.7.1 → codevira-4.0.0}/rules/smoke-testing.md +0 -0
  390. {codevira-3.7.1 → codevira-4.0.0}/rules/testing-standards.md +0 -0
  391. {codevira-3.7.1 → codevira-4.0.0}/setup.cfg +0 -0
  392. {codevira-3.7.1 → codevira-4.0.0}/tests/test__prompts.py +0 -0
  393. {codevira-3.7.1 → codevira-4.0.0}/tests/test_antigravity_hook_portable.py +0 -0
  394. {codevira-3.7.1 → codevira-4.0.0}/tests/test_call_edge_fk_safety.py +0 -0
  395. {codevira-3.7.1 → codevira-4.0.0}/tests/test_check_conflict.py +0 -0
  396. {codevira-3.7.1 → codevira-4.0.0}/tests/test_cli_export.py +0 -0
  397. {codevira-3.7.1 → codevira-4.0.0}/tests/test_cli_graph.py +0 -0
  398. {codevira-3.7.1 → codevira-4.0.0}/tests/test_cli_induce.py +0 -0
  399. {codevira-3.7.1 → codevira-4.0.0}/tests/test_cli_projects.py +0 -0
  400. {codevira-3.7.1 → codevira-4.0.0}/tests/test_cli_replay.py +0 -0
  401. {codevira-3.7.1 → codevira-4.0.0}/tests/test_cli_transfer.py +0 -0
  402. {codevira-3.7.1 → codevira-4.0.0}/tests/test_cli_uninstall.py +0 -0
  403. {codevira-3.7.1 → codevira-4.0.0}/tests/test_cli_untrack.py +0 -0
  404. {codevira-3.7.1 → codevira-4.0.0}/tests/test_cli_version.py +0 -0
  405. {codevira-3.7.1 → codevira-4.0.0}/tests/test_cli_working.py +0 -0
  406. {codevira-3.7.1 → codevira-4.0.0}/tests/test_committed_memory.py +0 -0
  407. {codevira-3.7.1 → codevira-4.0.0}/tests/test_crash_logger.py +0 -0
  408. {codevira-3.7.1 → codevira-4.0.0}/tests/test_cross_project_search.py +0 -0
  409. {codevira-3.7.1 → codevira-4.0.0}/tests/test_decisions_store.py +0 -0
  410. {codevira-3.7.1 → codevira-4.0.0}/tests/test_dedupe_migration.py +0 -0
  411. {codevira-3.7.1 → codevira-4.0.0}/tests/test_detect.py +0 -0
  412. {codevira-3.7.1 → codevira-4.0.0}/tests/test_e1_summary_first.py +0 -0
  413. {codevira-3.7.1 → codevira-4.0.0}/tests/test_eval_e3.py +0 -0
  414. {codevira-3.7.1 → codevira-4.0.0}/tests/test_fk_safety_extended.py +0 -0
  415. {codevira-3.7.1 → codevira-4.0.0}/tests/test_fork_safety.py +0 -0
  416. {codevira-3.7.1 → codevira-4.0.0}/tests/test_ghost_check.py +0 -0
  417. {codevira-3.7.1 → codevira-4.0.0}/tests/test_git_shared.py +0 -0
  418. {codevira-3.7.1 → codevira-4.0.0}/tests/test_gitignore.py +0 -0
  419. {codevira-3.7.1 → codevira-4.0.0}/tests/test_global_db.py +0 -0
  420. {codevira-3.7.1 → codevira-4.0.0}/tests/test_global_sync.py +0 -0
  421. {codevira-3.7.1 → codevira-4.0.0}/tests/test_graph_generator.py +0 -0
  422. {codevira-3.7.1 → codevira-4.0.0}/tests/test_hook_resilience.py +0 -0
  423. {codevira-3.7.1 → codevira-4.0.0}/tests/test_id_repair.py +0 -0
  424. {codevira-3.7.1 → codevira-4.0.0}/tests/test_launchd.py +0 -0
  425. {codevira-3.7.1 → codevira-4.0.0}/tests/test_log_retention.py +0 -0
  426. {codevira-3.7.1 → codevira-4.0.0}/tests/test_migrate.py +0 -0
  427. {codevira-3.7.1 → codevira-4.0.0}/tests/test_migration_memory_loss.py +0 -0
  428. {codevira-3.7.1 → codevira-4.0.0}/tests/test_migration_no_data_loss_e2e.py +0 -0
  429. {codevira-3.7.1 → codevira-4.0.0}/tests/test_opt_in.py +0 -0
  430. {codevira-3.7.1 → codevira-4.0.0}/tests/test_path_glob_and_scrub.py +0 -0
  431. {codevira-3.7.1 → codevira-4.0.0}/tests/test_paths.py +0 -0
  432. {codevira-3.7.1 → codevira-4.0.0}/tests/test_phase27_quality_fixes.py +0 -0
  433. {codevira-3.7.1 → codevira-4.0.0}/tests/test_pin_generation.py +0 -0
  434. {codevira-3.7.1 → codevira-4.0.0}/tests/test_project_binding.py +0 -0
  435. {codevira-3.7.1 → codevira-4.0.0}/tests/test_prompts.py +0 -0
  436. {codevira-3.7.1 → codevira-4.0.0}/tests/test_record_decision.py +0 -0
  437. {codevira-3.7.1 → codevira-4.0.0}/tests/test_registration_heal.py +0 -0
  438. {codevira-3.7.1 → codevira-4.0.0}/tests/test_remote_hijack.py +0 -0
  439. {codevira-3.7.1 → codevira-4.0.0}/tests/test_repair_ids.py +0 -0
  440. {codevira-3.7.1 → codevira-4.0.0}/tests/test_repair_ids_race.py +0 -0
  441. {codevira-3.7.1 → codevira-4.0.0}/tests/test_repair_init.py +0 -0
  442. {codevira-3.7.1 → codevira-4.0.0}/tests/test_retirement_and_amendments.py +0 -0
  443. {codevira-3.7.1 → codevira-4.0.0}/tests/test_review_round2.py +0 -0
  444. {codevira-3.7.1 → codevira-4.0.0}/tests/test_review_round3.py +0 -0
  445. {codevira-3.7.1 → codevira-4.0.0}/tests/test_roadmap_drift.py +0 -0
  446. {codevira-3.7.1 → codevira-4.0.0}/tests/test_sqlite_graph.py +0 -0
  447. {codevira-3.7.1 → codevira-4.0.0}/tests/test_sqlite_util.py +0 -0
  448. {codevira-3.7.1 → codevira-4.0.0}/tests/test_startup_migrations.py +0 -0
  449. {codevira-3.7.1 → codevira-4.0.0}/tests/test_supersede_on_write.py +0 -0
  450. {codevira-3.7.1 → codevira-4.0.0}/tests/test_synonym_widening_e5.py +0 -0
  451. {codevira-3.7.1 → codevira-4.0.0}/tests/test_tools_playbook.py +0 -0
  452. {codevira-3.7.1 → codevira-4.0.0}/tests/test_tools_roadmap.py +0 -0
  453. {codevira-3.7.1 → codevira-4.0.0}/tests/test_tools_skills.py +0 -0
  454. {codevira-3.7.1 → codevira-4.0.0}/tests/test_watcher_circuit.py +0 -0
  455. {codevira-3.7.1 → codevira-4.0.0}/tests/test_worktree_and_cache.py +0 -0
@@ -7,6 +7,446 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  ---
9
9
 
10
+ ## [Unreleased]
11
+
12
+ ## [4.0.0] — 2026-08-05
13
+
14
+ Promotes 4.0.0b1 to final — same feature set as the beta (tenant isolation,
15
+ content-addressed records, one MCP server per project). This release adds the
16
+ Claude Code per-project binding fixes below, plus the test-suite and stdio
17
+ hardening that landed during the beta. No product code changed between the
18
+ final real-machine verification of 4.0.0b1 and this tag beyond the fixes listed
19
+ here.
20
+
21
+ ### Fixed — Claude Code per-project MCP binding (setup / uninstall / untrack)
22
+
23
+ - **`codevira setup` registers Claude Code per-project.** A bare user-scope
24
+ entry (`args: []`, ambient cwd resolution) let the server bind to the wrong
25
+ project — a decision recorded in one repo could surface in another
26
+ (`get_roadmap` returning a sibling project). Setup now writes a scoped
27
+ `codevira-<slug>` entry pinned with `--project-dir` under
28
+ `projects[<path>].mcpServers`, and removes any pre-existing bare entry.
29
+ - **`codevira uninstall` sweeps per-project entries.** It cleaned only the
30
+ top-level `mcpServers`, leaving the scoped `codevira-<slug>` entries that
31
+ `setup` now writes under `projects[<path>].mcpServers`. It now sweeps both.
32
+ - **`codevira untrack <project>` sweeps per-project entries.** Same nested
33
+ blindness; it now removes the target project's scoped Claude Code entry too,
34
+ matched by its `--project-dir`.
35
+
36
+ ### Fixed — test suite: three process-global leaks made tests order-dependent
37
+
38
+ Seven tests passed in collection order — the order CI and `make test-unit` use
39
+ — and failed under a randomized order, so no gate could see them. An eighth
40
+ and ninth passed *vacuously*. Three leaks in the test harness, not in shipped
41
+ code:
42
+
43
+ - **`tests/test_index_codebase.py` mutated the real `rich` modules.** Two
44
+ helpers built fake `rich` sub-modules for `patch.dict(sys.modules, ...)`,
45
+ but when the real module was already imported — always, since `rich>=13` is
46
+ a hard dependency — they assigned `Console`/`Table`/`Panel` straight onto it.
47
+ `patch.dict` restores the `sys.modules` *mapping*; it cannot undo an
48
+ in-place attribute mutation on a module it never owned. Once those tests had
49
+ run, every later test in the process rendered through a `MagicMock`:
50
+ `cmd_status` output came back empty, or with `<MagicMock id=...>` where the
51
+ table belonged. Replaced with one `patch.object`-based context manager, which
52
+ unwinds. The `_restore_real_rich` fixture that partially papered over this
53
+ (it reloaded `rich.console`, never `rich.table` / `rich.panel`) is gone.
54
+ - **`crash_logger`'s two module-level caches survived across tests.** `_logger`
55
+ memoises a `RotatingFileHandler` bound to `<global_home>/logs/crashes.log` at
56
+ first use, and every test gets a different fake global home — so the first
57
+ test to record a crash kept every later `log_crash()` writing into *its* tmp
58
+ dir. `_recent_crashes`, the 60-second duplicate-suppression window, has the
59
+ same problem: the whole suite runs inside one window, so two tests raising
60
+ the same placeholder exception share a signature and the later write is
61
+ silently dropped. Both are now cleared per-test by the autouse
62
+ `_isolate_global_home` fixture.
63
+ - **`mcp_server.server._is_http_transport` latched `True` for the session.**
64
+ `run_http_server()` sets it and never unsets it — correct in production, one
65
+ process serves one transport — but once `tests/test_http_server.py` had run,
66
+ `_bind_project_from_client_roots` short-circuited for every later test. The
67
+ two positive cases in `tests/test_binding_e2e.py` failed; the two negative
68
+ cases ("must NOT bind") passed for the wrong reason, which is the more
69
+ dangerous half. A new autouse fixture clears it, and `_roots_bind_attempted`,
70
+ per test.
71
+
72
+ Regression guards added for each; each fails if its fix is reverted.
73
+
74
+ ### Added — a shuffled-order CI job (`make test-unit-random`)
75
+
76
+ Contributor-facing. `pytest-randomly` joins `[dev]`, and CI gains a
77
+ `test-random-order` job that runs the unit suite in a random order — the check
78
+ that would have caught all three leaks above years earlier. It is deliberately
79
+ **off by default**: the plugin auto-enables the moment it is installed, so
80
+ `addopts = ["-p", "no:randomly"]` keeps `pytest`, `make test-unit`,
81
+ `make test-e2e` and the release gauntlet in collection order, and only
82
+ `make test-unit-random` opts back in. On failure pytest-randomly prints the
83
+ seed it chose; reproduce with `--randomly-seed=<n>`.
84
+
85
+ ### Fixed — a background index thread wrote to the MCP stdio transport
86
+
87
+ `start_background_full_index()` runs `cmd_full_rebuild()` on a daemon thread
88
+ inside the MCP server process, where `sys.stdout` **is** the JSON-RPC
89
+ transport. `cmd_full_rebuild` rendered its progress bars and its
90
+ `✓ Graph built: N nodes, M edges.` line to a stdout `rich` Console, so an
91
+ auto-init rebuild could inject text mid-protocol and corrupt the stream for
92
+ any stdio client.
93
+
94
+ `cmd_incremental` already took a `quiet` flag and `start_background_watcher`
95
+ already passed `quiet=True`; `cmd_full_rebuild` was the missing half of that
96
+ pair. It now accepts `quiet` (which also mutes the `rich` Progress bars — they
97
+ share the console) and the background caller passes `quiet=True`. Completion
98
+ is logged via `logger.info`, so a quiet background run stays observable.
99
+ `codevira index --full` and `codevira init` output are unchanged.
100
+
101
+ Surfaced as an order-dependent CI failure: the stray line landed in an
102
+ unrelated test's captured stdout and broke its `json.loads`.
103
+
104
+ ### Fixed — `codevira search --json` could emit a non-JSON stdout
105
+
106
+ A machine-readable mode that emits nothing on failure turns a local problem
107
+ into an `Expecting value: line 1 column 1 (char 0)` several layers from the
108
+ cause. `--json` now writes exactly one JSON object on **every** exit path: a
109
+ backend exception yields `{query, count: 0, results: [], error}` with exit
110
+ code 1, a non-dict backend result is tolerated, and all human-readable
111
+ diagnostics go to stderr where they cannot pollute the document.
112
+
113
+ ---
114
+
115
+ ## [4.0.0b1] — 2026-08-01
116
+
117
+ > **Upgrading?** See [MIGRATING.md](MIGRATING.md). Take a snapshot first:
118
+ > `codevira memory snapshot --all-projects --note "before 4.0"`.
119
+
120
+ ### Breaking
121
+
122
+ - **`global.db` gains a `tenant` column** — the one change that cannot be
123
+ downgraded. Cross-project preferences and rules are now scoped to
124
+ `$CODEVIRA_TENANT` (default `local`). A single-user machine sees no
125
+ change; a shared `$HOME` (CI runner, devcontainer, server) stops
126
+ bleeding one person's learned state into another's. The `UNIQUE`
127
+ constraints were rebuilt to include `tenant` — without that, one tenant
128
+ holding a signal would permanently block another from storing it. The
129
+ migration verifies its row count and rolls back rather than completing
130
+ a lossy rewrite.
131
+ - **15 MCP tools removed (52 → 37 defined, 36 advertised)** — the
132
+ thirty-seventh, `refresh_graph`, is deliberately hidden from
133
+ `tools/list` and still callable; an agent counting its own tool list
134
+ sees 36. Each cut on measured usage across
135
+ 4,203 transcripts: the consensus (4), reflections (3), spatial (4) and
136
+ preferences (2) subsystems, plus `get_code` / `get_signature` (zero
137
+ calls in 2.5 months). `origin_of` is retained. The CLI subcommand
138
+ `codevira tune-weights` is also gone. **No recorded data is deleted** —
139
+ these were surfaces; `codevira export` still includes everything.
140
+ - **`session_log_enforcer` defaults to `block`** (was `warn`).
141
+ - **`codevira clean` now requires typing `uninstall`** and will no longer
142
+ accept a piped `y`. If you have a script doing `yes | codevira clean`
143
+ it will now abort — which is the point. `clean` is the full
144
+ uninstaller: it wipes `~/.codevira/` including snapshots, strips
145
+ codevira from every IDE config, and removes the launchd service. The
146
+ name says tidy-up. On 2026-08-01 that gap destroyed a real
147
+ installation on this project's own machine, so `clean` is deprecated
148
+ in favour of `codevira uninstall`, and `codevira reset`'s typed
149
+ confirmation (v2.1.2) now guards it too. Scripted use keeps working
150
+ via the explicit `--yes`; the fix targets *accidental* confirmation.
151
+
152
+ ### Added — a way back, and a way to enforce everywhere
153
+
154
+ - **`codevira memory snapshot | list | undo`.** `.codevira/` is
155
+ gitignored, so `git revert` could never roll back the memory store.
156
+ Now something can — and undo is itself undoable, because restoring
157
+ captures the current state first. `--all-projects` covers every
158
+ registered repo.
159
+ - **Commit-boundary enforcement.** `codevira engine install-git-hook`
160
+ runs locked decisions against staged changes through the same engine
161
+ the IDE hooks use, so a `do_not_revert` decision is a physical veto in
162
+ *any* editor — they all commit with git. Merge commits are never
163
+ blocked; `git commit --no-verify` overrides once.
164
+ - **`mcp_server/egress.py`** is now the only module permitted to import a
165
+ network client, enforced by a CI test that walks the import graph and
166
+ fails the build. `CODEVIRA_NO_NETWORK=1` is an absolute kill switch,
167
+ checked before any config file. The entire network surface remains one
168
+ advisory PyPI version check.
169
+ - **`$CODEVIRA_HOME`** relocates the global data directory — separate
170
+ profiles, containers with a read-only `$HOME`, CI runners.
171
+ - **`codevira prune`** — the tidy-up `clean` sounded like. Removes
172
+ project data dirs whose path no longer exists, `global.db` rows
173
+ pointing at nothing, ghost dirs from interrupted inits, and legacy
174
+ `.codevira.migrated/` backups. Decisions, IDE configs and hooks are
175
+ never touched. `--dry-run` first; `--orphans` / `--ghosts` /
176
+ `--legacy` to narrow. The safe operations used to be the ones hidden
177
+ behind flags while the destructive one was the bare default — that is
178
+ now inverted.
179
+
180
+ ### Fixed — the sdist shipped a test suite that could not run
181
+
182
+ Left to itself, setuptools inherits distutils' legacy `test*.py` default:
183
+ non-recursive, and no match for `conftest.py`. The result was **96 of 167
184
+ test files** — the flat `tests/` directory alone, without `e2e/`,
185
+ `integration/`, `engine/` or `storage/`, and without the conftest that
186
+ sets `CODEVIRA_HOME` and prepends the repo to `PYTHONPATH`.
187
+
188
+ Missing those two lines, a packager building from the sdist would have
189
+ had the suite write into their own `~/.codevira/` and import
190
+ site-packages instead of the tree under test — the two bugs this release
191
+ fixes for us, packaged for redelivery. `MANIFEST.in` now states the
192
+ intent explicitly, including the e2e fixtures' `.md`/`.json`/`.ts`/`.yaml`
193
+ that a `*.py` rule would have shipped the tests without.
194
+
195
+ The wheel is byte-identical: this touches only the sdist.
196
+
197
+ - Contributors: the `check_real_ide_smoke.sh` gate (G3) no longer
198
+ registers its throwaway project in your real `~/.codevira/`. It boots
199
+ under its own `CODEVIRA_HOME`, so a killed run leaves nothing either.
200
+
201
+ ### Fixed — memory that survives a two-host merge
202
+
203
+ - **A stable machine identity (`origin.device_id`).** `host_hash` derived
204
+ from `uuid.getnode()`, which returns whichever of a laptop's many
205
+ interfaces enumerates first — measured **4 distinct values from one
206
+ machine over 7 weeks**, two of them live concurrently. `id_repair` keys
207
+ amendment attribution on writer identity, so a developer whose VPN
208
+ reconnected became a stranger to their own decision.
209
+ - **Amendments record who made them.** `mark_protected`, `reaffirm`,
210
+ `mark_outdated`, `set_flag` and `supersede` wrote anonymous rows (0 of
211
+ 96 carried provenance), so on a two-host merge a supersession landed on
212
+ whoever won the id race — retiring the wrong engineer's decision.
213
+ - **`id_repair` repoints decision-to-decision edges.** It renumbered
214
+ colliding records without updating `superseded_by`, leaving dangling
215
+ supersessions.
216
+ - **Content-addressed `uid`** on every record, plus `_amendment_to_uid`
217
+ edges so attribution needs no heuristic. Deliberately *not* `uuid4`,
218
+ which measurably breaks cherry-pick dedup (1 record → 2). **Nothing is
219
+ back-filled** — a pre-4.0 record's uid derives from its content.
220
+ - **`origin` and `uid` are never overlaid onto a base record** by an
221
+ amendment, so amending someone else's decision no longer rewrites its
222
+ authorship.
223
+
224
+ ### Changed — less surface, faster reads
225
+
226
+ - Warm-call p95 **10.18 ms → 1.92 ms** against D00012K's 3 ms ceiling.
227
+ - One ranking definition (`mcp_server/retrieval/score.py`) replaces four
228
+ implementations on three incompatible scales.
229
+ - `symbol` is derived from the session's own edit instead of being typed
230
+ by an agent (it sat at 1 of 123 populated).
231
+
232
+ ### Added — the product explains itself (Step 2)
233
+
234
+ A refusal used to show an id, 120 truncated characters and a date. It now
235
+ carries the decision's reasoning, the alternatives that were rejected, and the
236
+ condition that would justify revisiting it — so a `do_not_revert` lock is
237
+ something a user can actually satisfy rather than a ratchet nobody dares touch.
238
+
239
+ - `record_decision` now **declares and forwards** `alternatives_considered` and
240
+ `would_re_examine_if`. Both were accepted by every layer beneath the MCP
241
+ surface since v3.1.x but never declared in the inputSchema, so they read
242
+ 0/1365 across every project — a dead write path, not agent laziness.
243
+ - `write_session_log` gains `task_type` + `skill_ids`. Skill induction filters
244
+ on `task_type`; with 62/62 sessions at `None` it was structurally guaranteed
245
+ to yield nothing regardless of usage.
246
+ - `context` now reaches every reader: `search_decisions`, the digest that feeds
247
+ prompt injection, and the injected block itself.
248
+
249
+ ### Fixed — cross-project memory bleed in the engine
250
+
251
+ Both halves of the engine resolved storage paths **ambiently** rather than from
252
+ the project the event came from. Verified live: a context built for a fresh
253
+ one-decision project returned 10 of another project's decisions including its
254
+ `do_not_revert` locks, and a `UserPromptSubmit` was injected with a different
255
+ repo's decisions.
256
+
257
+ This is the enforcement- and injection-side twin of the v3.7.1 binding bugs, and
258
+ it is the symptom that caused enforcement to be switched off on two large
259
+ projects (D00012O).
260
+
261
+ - `signals.decisions()` / `signals.search_decisions()` → scoped
262
+ - `relevance_inject` `_load_indexes` / `_fts_candidates` / `_config` → scoped
263
+ (a project can no longer inherit another's injection budget)
264
+ - `decisions_store.list_all()` gains `project_root`; `None` preserves prior
265
+ behaviour for every other caller
266
+
267
+ ### Fixed — pre-release builds silently stopped receiving update notices
268
+
269
+ `_is_newer` applied the strict release-only parser to the **local** version, so
270
+ any `dev`/`rc`/`a`/`b`/`post`/`+local` build parsed to `None` and never
271
+ notified. `latest` stays strict — we never nag toward a pre-release.
272
+
273
+ ### Added — per-verdict enforcement audit log
274
+
275
+ `decision_lock`, `anti_regression` and `blast_radius` recorded nothing, so the
276
+ false-block rate was unmeasurable. Verdicts now append to
277
+ `.codevira-cache/enforcement.jsonl` with `host_hash`, `version` and `ide`.
278
+ Cache-only, bounded, and provably unable to change a verdict.
279
+
280
+ ### Removed — Windsurf is no longer a supported injection target
281
+
282
+ Windsurf was discontinued (folded into Cursor), so codevira no longer
283
+ auto-detects it or writes MCP config for it. Removed from setup detection,
284
+ the `--ide` menu, `inject_ide_config`, doctor hints, and all user-facing
285
+ docs/website. **Backward-compatible:** `origin.py` still *recognizes*
286
+ `"windsurf"` so decisions recorded by Windsurf before 4.0 read back
287
+ correctly, and `codevira uninstall` / `untrack` still clean up any existing
288
+ `.windsurf/` and `.windsurfrules` files left on disk. No migration needed —
289
+ nothing writes new Windsurf entries, and existing ones are inert.
290
+
291
+ ### Changed — `session_log_enforcer` defaults to `block` (data-gated flip)
292
+
293
+ v3.3.0 shipped the enforcer in `warn` mode with instrumentation, promising to
294
+ flip the default "once that data confirms warn-mode is low-noise". The recorded
295
+ data (`.codevira-cache/enforcer_outcomes.jsonl`) now says so: **324 STOP
296
+ evaluations over 7 weeks — 218 compliant / 22 gap_warned / 84 skip_no_commits**,
297
+ a 9% warn rate on commit-bearing sessions.
298
+
299
+ A session that ships commits without calling `write_session_log` now has its
300
+ Stop refused so the AI can write the log, rather than getting a nudge it can
301
+ ignore.
302
+
303
+ - `CODEVIRA_SESSION_LOG_ENFORCER_MODE=warn` restores the previous default;
304
+ `=off` disables the policy entirely.
305
+ - **Honest caveat:** the sample is 7 distinct sessions on one maintainer
306
+ machine — the compliance ceiling, not a representative population. Expect a
307
+ higher fire rate in the wild, and the escape hatch above to matter.
308
+
309
+ ### Fixed — Stop-event blocks re-engage the AI instead of halting the turn
310
+
311
+ Found while flipping the enforcer default. `claude_code_hooks._emit` emitted
312
+ `{"continue": false, "stopReason": ...}` for **every** blocking verdict. On
313
+ `Stop` that ends Claude's processing and addresses the *user* — the opposite of
314
+ the documented block-mode behavior ("force the AI to retry"). Any Stop policy
315
+ that blocked would have cut the final response off.
316
+
317
+ - Stop / SubagentStop blocks now emit `{"decision": "block", "reason": ...}`,
318
+ which refuses the stop and feeds the reason back to the AI.
319
+ - Claude Code's `stop_hook_active` flag (previously read nowhere in the
320
+ codebase) now degrades the second consecutive block to a warn, so a policy
321
+ the AI *cannot* satisfy — MCP unreachable, read-only store — can never loop.
322
+ - PreToolUse / UserPromptSubmit block shapes are unchanged, with a regression
323
+ test pinning that.
324
+
325
+ ### Added — `codevira register-all`: one MCP per project (heals wrong-project binding)
326
+
327
+ The shared "single `codevira` entry that auto-detects the project" model proved
328
+ fragile: a bare (project-less) entry out-ranks project-scoped ones, so a session
329
+ opened in project A could read project B's memory (the "opened LH, got UDAP"
330
+ class of bug). On non-project-aware clients (Claude Desktop, Antigravity) there
331
+ is no reliable auto-detect at all.
332
+
333
+ `codevira register-all` abandons auto-detect for the reliable model: it **zeroes
334
+ every `codevira*` MCP entry** across all detected IDEs, then registers each
335
+ discovered project as its **own uniquely-named MCP** (`codevira-<slug>`)
336
+ hard-pinned to `--project-dir`. One MCP per project — no collisions.
337
+
338
+ - **Dynamic discovery, nothing hardcoded.** Projects are the union of dirs
339
+ already registered in an IDE config and dirs with a `.codevira/` store found
340
+ by scanning the ancestors of those (plus any `--scan-root`). Nested monorepo
341
+ sub-stores (e.g. `repo/packages/db/.codevira`) are excluded automatically.
342
+ - **Safe.** Every config is backed up (`*.bak-registerall-*`) before it is
343
+ rewritten, and only `codevira*` keys are touched — all other MCP servers and
344
+ settings are preserved. `--dry-run` shows the plan and writes nothing.
345
+ - Spans Claude Code (project-scope), Claude Desktop, and Antigravity.
346
+
347
+ ### Added — `codevira doctor --fix`
348
+
349
+ `doctor` flagged a bare-global-entry binding conflict and told users to run
350
+ `codevira init`, but `init` only warned and never removed the bare entry.
351
+ `codevira doctor --fix` now applies the auto-fixer for any WARN/FAIL check that
352
+ has one (currently: remove the bare `codevira` entry that shadows project pins),
353
+ backing up `~/.claude.json` first and touching only the `codevira` key.
354
+
355
+ ### Fixed — Claude Desktop setup overwrote the previous project (wrong-project bleed)
356
+
357
+ Claude Desktop is **not project-aware** — it reads one global config with no
358
+ per-window `cwd`. But `codevira setup` wrote every project under the *same* bare
359
+ `codevira` key, so setting up a second project silently overwrote the first and
360
+ Desktop pointed every project at whichever was configured last. Setup now mints a
361
+ **named per-project entry** (`codevira-<project>`) for Desktop, matching the
362
+ Antigravity path and byte-identical to what `register-all` / `doctor --fix` write
363
+ (no duplicate keys). Existing bare entries are still healed by those commands.
364
+
365
+ ### Fixed — git worktrees fragmented memory (and a migration to re-unify it)
366
+
367
+ A `.git` file (not dir) meant a linked worktree looked like its own project, so
368
+ `codevira_dir()` gave each worktree a **separate** `.codevira/` — decisions made
369
+ in a worktree couldn't be merged back to the main checkout. Now a linked
370
+ worktree's memory redirects to the **main** worktree root (opt out with
371
+ `CODEVIRA_WORKTREE_ISOLATED=1`), so worktrees write straight into the shared
372
+ store — nothing to merge. Honors the write-path root validation (`D000012`): if
373
+ the derived main root is invalid, it falls back to the worktree rather than
374
+ writing memory somewhere bad.
375
+
376
+ For worktrees that already wrote their own `.codevira/` before this fix, a
377
+ startup migration folds those decisions into the main store via the same
378
+ union+dedup as the git merge driver, then renames the worktree store to
379
+ `.codevira.premerge-<ts>` — **never deleted** (honors `D00011Z`). Re-runs on
380
+ every startup, so it self-heals.
381
+
382
+ ---
383
+
384
+ ### Fixed — a background auto-init could report progress into a record it no longer owned
385
+
386
+ `auto_init._update_progress` re-resolved the module global `_progress` on every
387
+ write, so an init run that was still going after that global had been rebound
388
+ underneath it wrote its stale status into the *current* record. Production never
389
+ rebinds `_progress`, so runtime behaviour is unchanged — but any harness that
390
+ re-initialises module state (the test suite does, between tests) could have a
391
+ finished-with run stamp `status="indexing"` over a fresh record.
392
+
393
+ `ensure_project_initialized` now hands the thread the progress record that
394
+ exists when it launches, and `_update_progress` takes an optional
395
+ positional-only `_record`. Late writes from a superseded run land in their own
396
+ abandoned dict instead of the live one.
397
+
398
+ This surfaced as two intermittent CI failures that no amount of state-resetting
399
+ could fix, because the reset and the stale write are concurrent by construction:
400
+ `test_auto_init.py::TestGetInitProgress::test_default_state`
401
+ (`assert 'indexing' == 'not_started'`, Python 3.10 job only) and
402
+ `test_tools_graph.py::TestGetNode::test_get_node_not_indexed_returns_null_counts`
403
+ (`KeyError: 'not_indexed'`, order-independent).
404
+
405
+ ### Fixed — the test suite now fails any test that leaks a background thread
406
+
407
+ Every thread codevira starts is named `codevira-*`. A new autouse fixture joins
408
+ any that are still alive at teardown and fails the test if one survives, so a
409
+ leaked thread can no longer run inside a later, unrelated test — mutating its
410
+ module state and writing to the filesystem after that test's `$HOME` and
411
+ `get_data_dir` patches have been torn down. Set
412
+ `CODEVIRA_TEST_THREAD_JOIN_TIMEOUT=0` to run it as a zero-grace audit.
413
+
414
+ ### Fixed — `get_node` broke the v2.1.2 Item 2 contract during background indexing
415
+
416
+ `get_node()` has four not-found branches. Three of them (no graph DB / empty
417
+ graph / file absent from a populated graph) carried the v2.1.2 Item 2 contract:
418
+ every not-found return ships `not_indexed: True` plus `null` for
419
+ `rules_count`, `dependencies_count` and `key_functions_count`, precisely so an
420
+ agent cannot confuse "never indexed" with "indexed and genuinely has zero
421
+ dependencies".
422
+
423
+ The fourth branch did not. The v1.6 early return taken while auto-init's
424
+ background index is still running (`get_init_progress()["status"]` is
425
+ `initializing` or `indexing`) predated Item 2 and returned only
426
+ `found` / `status` / `file_path` / `message` / `hint`. An AI agent that called
427
+ `get_node` mid-index got a `KeyError` on `result["not_indexed"]`, or — reading
428
+ via `.get()` — saw the fields absent, which is the exact ambiguity Item 2 was
429
+ written to remove.
430
+
431
+ The root cause was placement, not an omission: the shared `_not_indexed_counts`
432
+ dict was defined *below* the auto-init check, so the initializing branch could
433
+ not reference it. It is now hoisted to the top of the `if not node:` block, so
434
+ one definition serves all four branches and any branch added later has the
435
+ contract in scope. `status`, `message` and `hint` are unchanged — this is
436
+ purely additive to the response.
437
+
438
+ `get_impact()` was checked for the same hole and does **not** have one: it has
439
+ no initializing early return and falls through to its three
440
+ contract-carrying branches. The regression test asserts `get_impact`'s contract
441
+ under `status="indexing"` anyway, so one cannot be introduced later.
442
+
443
+ Diagnosis in `D000138`; the code fix landed in `03c461a`, covered by
444
+ `tests/test_graph_not_indexed_contract.py` (parametrised over every
445
+ `_progress["status"]` value, because the defect was a *missing* case and a test
446
+ that only covers the known case cannot catch the next one).
447
+
448
+ ---
449
+
10
450
  ## [3.7.1] — 2026-07-20
11
451
 
12
452
  ### Fixed — the centralization migration silently orphaned ALL memory (critical)
@@ -0,0 +1,25 @@
1
+ include README.md
2
+ include LICENSE
3
+ include CHANGELOG.md
4
+ include config.example.yaml
5
+ recursive-include agents *.md
6
+ recursive-include rules *.md
7
+ recursive-include docs *.md
8
+ recursive-include graph *.yaml
9
+
10
+ # Ship the WHOLE test tree or none of it. Left to itself, setuptools
11
+ # inherits distutils' legacy default of `test*.py` in the test dir —
12
+ # non-recursive, and no match for `conftest.py`. That shipped 96 of 167
13
+ # test files: the flat tests/ directory only, without the conftest that
14
+ # sets CODEVIRA_HOME and PYTHONPATH, and without e2e/ (the G2 gate),
15
+ # integration/ (G1.5), engine/ or storage/.
16
+ #
17
+ # A packager building from that sdist gets a suite that is not merely
18
+ # incomplete but harmful: no CODEVIRA_HOME means it writes into their
19
+ # real ~/.codevira/, and no PYTHONPATH means subprocess tests import
20
+ # site-packages instead of the tree being tested. Both are bugs this
21
+ # release fixed for us and would have re-inflicted on them.
22
+ recursive-include tests *.py
23
+ recursive-include tests/e2e/fixtures *
24
+ global-exclude __pycache__/*
25
+ global-exclude *.py[cod]