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