hcr-memory 0.5.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 (367) hide show
  1. hcr_memory-0.5.0/LICENSE +6 -0
  2. hcr_memory-0.5.0/MANIFEST.in +11 -0
  3. hcr_memory-0.5.0/PKG-INFO +632 -0
  4. hcr_memory-0.5.0/README.md +581 -0
  5. hcr_memory-0.5.0/docs/AUDIT_AND_FIXES_SUMMARY.md +266 -0
  6. hcr_memory-0.5.0/docs/AUDIT_TODO.md +336 -0
  7. hcr_memory-0.5.0/docs/COMMERCIAL_READINESS_CHECKLIST.md +71 -0
  8. hcr_memory-0.5.0/docs/MCP_AUDIT_REPORT.md +284 -0
  9. hcr_memory-0.5.0/docs/MCP_TOOLS_USAGE_GUIDE.md +399 -0
  10. hcr_memory-0.5.0/docs/NORTHSTAR.md +781 -0
  11. hcr_memory-0.5.0/docs/PLAN23_RETRIEVAL_HARDENING.md +155 -0
  12. hcr_memory-0.5.0/docs/alice_context_continuity_guide.md +140 -0
  13. hcr_memory-0.5.0/docs/alice_scenario.md +242 -0
  14. hcr_memory-0.5.0/docs/architecture.md +269 -0
  15. hcr_memory-0.5.0/docs/archive/CODE_REVIEW_2026_04_28.md +526 -0
  16. hcr_memory-0.5.0/docs/archive/COMPLETE_TRANSFORMATION_SUMMARY.md +488 -0
  17. hcr_memory-0.5.0/docs/archive/HCR-Northstar-v2.md +876 -0
  18. hcr_memory-0.5.0/docs/archive/HCR-Northstar-v3.md +695 -0
  19. hcr_memory-0.5.0/docs/archive/HybridCognitiveRuntime-Northstar.md +1084 -0
  20. hcr_memory-0.5.0/docs/archive/PHASE1_DETAILED_CHANGELOG.md +366 -0
  21. hcr_memory-0.5.0/docs/archive/PHASE1_FIXES_COMPLETED.md +210 -0
  22. hcr_memory-0.5.0/docs/archive/PHASE2_DETAILED_CHANGELOG.md +484 -0
  23. hcr_memory-0.5.0/docs/archive/PHASE2_IMPROVEMENTS.md +491 -0
  24. hcr_memory-0.5.0/docs/archive/PHASE2_SUMMARY.md +304 -0
  25. hcr_memory-0.5.0/docs/archive/PHASE3B_IMPLEMENTATION_ROADMAP.md +488 -0
  26. hcr_memory-0.5.0/docs/archive/PHASE3D_COMPLETE.md +516 -0
  27. hcr_memory-0.5.0/docs/archive/PHASE3_ARCHITECTURE.md +576 -0
  28. hcr_memory-0.5.0/docs/archive/PHASE3_QUICK_REFERENCE.md +389 -0
  29. hcr_memory-0.5.0/docs/archive/REALITY_CHECK_2026_05_01.md +582 -0
  30. hcr_memory-0.5.0/docs/archive/WEEK1_COMPLETION.md +136 -0
  31. hcr_memory-0.5.0/docs/archive/WEEK2_COMPLETION.md +160 -0
  32. hcr_memory-0.5.0/docs/archive/phase2_plan.md +176 -0
  33. hcr_memory-0.5.0/docs/commercial_log.md +31 -0
  34. hcr_memory-0.5.0/docs/dev_log.md +3139 -0
  35. hcr_memory-0.5.0/docs/hcr_engine_internals.md +599 -0
  36. hcr_memory-0.5.0/docs/hcr_flow_diagram.md +198 -0
  37. hcr_memory-0.5.0/docs/mcp_tool_audit_report.md +806 -0
  38. hcr_memory-0.5.0/docs/mcp_tool_test_results_2026-05-04.md +473 -0
  39. hcr_memory-0.5.0/docs/product_roadmap.md +117 -0
  40. hcr_memory-0.5.0/docs/project_memory.md +1110 -0
  41. hcr_memory-0.5.0/docs/research/causal_prefix_alignment.md +95 -0
  42. hcr_memory-0.5.0/docs/research/market_positioning_2026.md +302 -0
  43. hcr_memory-0.5.0/docs/research/mcp_server_hosting_requirements_2026.md +355 -0
  44. hcr_memory-0.5.0/docs/research/token_benchmark_report.md +100 -0
  45. hcr_memory-0.5.0/docs/strategic_vision.md +189 -0
  46. hcr_memory-0.5.0/docs/superpowers/plans/2026-05-25-mcp-tool-commercial-grade-fixes.md +494 -0
  47. hcr_memory-0.5.0/docs/superpowers/plans/2026-05-27-cpap-implementation.md +1342 -0
  48. hcr_memory-0.5.0/docs/superpowers/plans/2026-05-27-v1-unified-context-layer.md +1140 -0
  49. hcr_memory-0.5.0/docs/superpowers/plans/2026-05-30-hcr-core-loop-hardening.md +1172 -0
  50. hcr_memory-0.5.0/docs/superpowers/plans/2026-06-14-cross-surface-continuity.md +1775 -0
  51. hcr_memory-0.5.0/docs/superpowers/plans/2026-06-14-retrieval-quality-maximization.md +855 -0
  52. hcr_memory-0.5.0/docs/superpowers/plans/2026-06-21-seed-docs.md +796 -0
  53. hcr_memory-0.5.0/docs/superpowers/plans/2026-06-23-tool-api-tightening.md +598 -0
  54. hcr_memory-0.5.0/docs/superpowers/plans/2026-06-25-ship-by-july-1.md +1024 -0
  55. hcr_memory-0.5.0/docs/superpowers/specs/2026-05-27-cpap-design.md +266 -0
  56. hcr_memory-0.5.0/docs/superpowers/specs/2026-07-03-cli-rework-design.md +245 -0
  57. hcr_memory-0.5.0/docs/superpowers/specs/2026-07-03-production-hardening-design.md +667 -0
  58. hcr_memory-0.5.0/docs/system_prompts/chatgpt.md +41 -0
  59. hcr_memory-0.5.0/docs/system_prompts/claude.md +36 -0
  60. hcr_memory-0.5.0/docs/system_prompts/gemini.md +30 -0
  61. hcr_memory-0.5.0/docs/tasks.md +257 -0
  62. hcr_memory-0.5.0/hcr/.hcr/cpap_epoch.json +1 -0
  63. hcr_memory-0.5.0/hcr/__init__.py +27 -0
  64. hcr_memory-0.5.0/hcr/engine/__init__.py +33 -0
  65. hcr_memory-0.5.0/hcr/engine/causal/__init__.py +16 -0
  66. hcr_memory-0.5.0/hcr/engine/causal/ast_extractor.py +58 -0
  67. hcr_memory-0.5.0/hcr/engine/causal/co_change_miner.py +96 -0
  68. hcr_memory-0.5.0/hcr/engine/causal/cso_impact.py +110 -0
  69. hcr_memory-0.5.0/hcr/engine/causal/dependency_graph.py +89 -0
  70. hcr_memory-0.5.0/hcr/engine/causal/event_store.py +270 -0
  71. hcr_memory-0.5.0/hcr/engine/causal/impact_analyzer.py +35 -0
  72. hcr_memory-0.5.0/hcr/engine/causal/metrics.py +56 -0
  73. hcr_memory-0.5.0/hcr/engine/causal/temporal_correlator.py +409 -0
  74. hcr_memory-0.5.0/hcr/engine/core/__init__.py +3 -0
  75. hcr_memory-0.5.0/hcr/engine/cso/__init__.py +5 -0
  76. hcr_memory-0.5.0/hcr/engine/cso/agent_registry.py +55 -0
  77. hcr_memory-0.5.0/hcr/engine/cso/backend.py +133 -0
  78. hcr_memory-0.5.0/hcr/engine/cso/cso_migrator.py +74 -0
  79. hcr_memory-0.5.0/hcr/engine/cso/cso_model.py +108 -0
  80. hcr_memory-0.5.0/hcr/engine/cso/cso_store.py +970 -0
  81. hcr_memory-0.5.0/hcr/engine/engine_api.py +1784 -0
  82. hcr_memory-0.5.0/hcr/engine/inference/__init__.py +15 -0
  83. hcr_memory-0.5.0/hcr/engine/inference/constraint_learner.py +233 -0
  84. hcr_memory-0.5.0/hcr/engine/inference/narrator.py +151 -0
  85. hcr_memory-0.5.0/hcr/engine/inference/predictor.py +160 -0
  86. hcr_memory-0.5.0/hcr/engine/inference/tracer.py +234 -0
  87. hcr_memory-0.5.0/hcr/engine/llm/__init__.py +11 -0
  88. hcr_memory-0.5.0/hcr/engine/llm/llm_provider.py +191 -0
  89. hcr_memory-0.5.0/hcr/engine/llm/providers/__init__.py +3 -0
  90. hcr_memory-0.5.0/hcr/engine/llm/providers/anthropic.py +116 -0
  91. hcr_memory-0.5.0/hcr/engine/llm/providers/google.py +115 -0
  92. hcr_memory-0.5.0/hcr/engine/llm/providers/groq.py +168 -0
  93. hcr_memory-0.5.0/hcr/engine/llm/providers/ollama.py +135 -0
  94. hcr_memory-0.5.0/hcr/engine/llm/providers/openai.py +108 -0
  95. hcr_memory-0.5.0/hcr/engine/memory/__init__.py +52 -0
  96. hcr_memory-0.5.0/hcr/engine/memory/ccr_store.py +77 -0
  97. hcr_memory-0.5.0/hcr/engine/memory/centrality.py +105 -0
  98. hcr_memory-0.5.0/hcr/engine/memory/commit_extractor.py +279 -0
  99. hcr_memory-0.5.0/hcr/engine/memory/constraint_propagation.py +478 -0
  100. hcr_memory-0.5.0/hcr/engine/memory/context_export.py +178 -0
  101. hcr_memory-0.5.0/hcr/engine/memory/cpap.py +542 -0
  102. hcr_memory-0.5.0/hcr/engine/memory/dedup.py +150 -0
  103. hcr_memory-0.5.0/hcr/engine/memory/embedding_store.py +549 -0
  104. hcr_memory-0.5.0/hcr/engine/memory/feedback.py +426 -0
  105. hcr_memory-0.5.0/hcr/engine/memory/fusion.py +147 -0
  106. hcr_memory-0.5.0/hcr/engine/memory/git_ingestion.py +666 -0
  107. hcr_memory-0.5.0/hcr/engine/memory/hyde.py +131 -0
  108. hcr_memory-0.5.0/hcr/engine/memory/implicit_graph.py +40 -0
  109. hcr_memory-0.5.0/hcr/engine/memory/merger.py +255 -0
  110. hcr_memory-0.5.0/hcr/engine/memory/prefetch.py +148 -0
  111. hcr_memory-0.5.0/hcr/engine/memory/projection.py +528 -0
  112. hcr_memory-0.5.0/hcr/engine/memory/prospective.py +59 -0
  113. hcr_memory-0.5.0/hcr/engine/memory/reranker.py +81 -0
  114. hcr_memory-0.5.0/hcr/engine/memory/serializers.py +253 -0
  115. hcr_memory-0.5.0/hcr/engine/memory/session_miner.py +238 -0
  116. hcr_memory-0.5.0/hcr/engine/memory/sync.py +297 -0
  117. hcr_memory-0.5.0/hcr/engine/state/__init__.py +11 -0
  118. hcr_memory-0.5.0/hcr/engine/state/cognitive_state.py +140 -0
  119. hcr_memory-0.5.0/hcr/engine/symbolic/__init__.py +6 -0
  120. hcr_memory-0.5.0/hcr/engine/symbolic/friction_detector.py +86 -0
  121. hcr_memory-0.5.0/hcr/engine/symbolic/profile_manager.py +103 -0
  122. hcr_memory-0.5.0/hcr/engine/symbolic/rules.py +203 -0
  123. hcr_memory-0.5.0/hcr/engine/symbolic/verifier.py +39 -0
  124. hcr_memory-0.5.0/hcr/product/PRODUCT_SPEC.md +436 -0
  125. hcr_memory-0.5.0/hcr/product/SYSTEM_DESIGN.md +1102 -0
  126. hcr_memory-0.5.0/hcr/product/__init__.py +3 -0
  127. hcr_memory-0.5.0/hcr/product/__main__.py +4 -0
  128. hcr_memory-0.5.0/hcr/product/api/__init__.py +2 -0
  129. hcr_memory-0.5.0/hcr/product/api/apikeys.py +141 -0
  130. hcr_memory-0.5.0/hcr/product/api/auth.py +117 -0
  131. hcr_memory-0.5.0/hcr/product/api/circuit_breaker.py +50 -0
  132. hcr_memory-0.5.0/hcr/product/api/cpap_store.py +150 -0
  133. hcr_memory-0.5.0/hcr/product/api/csos.py +118 -0
  134. hcr_memory-0.5.0/hcr/product/api/device.py +158 -0
  135. hcr_memory-0.5.0/hcr/product/api/main.py +80 -0
  136. hcr_memory-0.5.0/hcr/product/api/mcp_endpoint.py +79 -0
  137. hcr_memory-0.5.0/hcr/product/api/memory.py +114 -0
  138. hcr_memory-0.5.0/hcr/product/api/middleware.py +74 -0
  139. hcr_memory-0.5.0/hcr/product/api/preflight.py +76 -0
  140. hcr_memory-0.5.0/hcr/product/api/rate_limit.py +113 -0
  141. hcr_memory-0.5.0/hcr/product/api/state.py +146 -0
  142. hcr_memory-0.5.0/hcr/product/api/stream.py +121 -0
  143. hcr_memory-0.5.0/hcr/product/api/supabase_client.py +29 -0
  144. hcr_memory-0.5.0/hcr/product/api/teams.py +543 -0
  145. hcr_memory-0.5.0/hcr/product/api/telemetry.py +59 -0
  146. hcr_memory-0.5.0/hcr/product/auth/__init__.py +3 -0
  147. hcr_memory-0.5.0/hcr/product/auth/jwt_handler.py +78 -0
  148. hcr_memory-0.5.0/hcr/product/auth/refresh.py +45 -0
  149. hcr_memory-0.5.0/hcr/product/auth/token_store.py +123 -0
  150. hcr_memory-0.5.0/hcr/product/auto_init.py +157 -0
  151. hcr_memory-0.5.0/hcr/product/caching/__init__.py +5 -0
  152. hcr_memory-0.5.0/hcr/product/caching/cache.py +119 -0
  153. hcr_memory-0.5.0/hcr/product/cli/__init__.py +6 -0
  154. hcr_memory-0.5.0/hcr/product/cli/auth_cmd.py +75 -0
  155. hcr_memory-0.5.0/hcr/product/cli/banner.py +71 -0
  156. hcr_memory-0.5.0/hcr/product/cli/commands/__init__.py +2 -0
  157. hcr_memory-0.5.0/hcr/product/cli/commands/auth.py +196 -0
  158. hcr_memory-0.5.0/hcr/product/cli/commands/doctor.py +346 -0
  159. hcr_memory-0.5.0/hcr/product/cli/commands/export_cmd.py +145 -0
  160. hcr_memory-0.5.0/hcr/product/cli/commands/forget.py +89 -0
  161. hcr_memory-0.5.0/hcr/product/cli/commands/init_cmd.py +452 -0
  162. hcr_memory-0.5.0/hcr/product/cli/commands/remember.py +58 -0
  163. hcr_memory-0.5.0/hcr/product/cli/commands/search.py +174 -0
  164. hcr_memory-0.5.0/hcr/product/cli/commands/setup_cmd.py +61 -0
  165. hcr_memory-0.5.0/hcr/product/cli/commands/status.py +177 -0
  166. hcr_memory-0.5.0/hcr/product/cli/commands/sync.py +447 -0
  167. hcr_memory-0.5.0/hcr/product/cli/commands.py +170 -0
  168. hcr_memory-0.5.0/hcr/product/cli/doctor.py +226 -0
  169. hcr_memory-0.5.0/hcr/product/cli/explain.py +112 -0
  170. hcr_memory-0.5.0/hcr/product/cli/install.py +75 -0
  171. hcr_memory-0.5.0/hcr/product/cli/main.py +407 -0
  172. hcr_memory-0.5.0/hcr/product/cli/resume.py +315 -0
  173. hcr_memory-0.5.0/hcr/product/cli/setup.py +49 -0
  174. hcr_memory-0.5.0/hcr/product/cli/theme.py +53 -0
  175. hcr_memory-0.5.0/hcr/product/cli/ui.py +305 -0
  176. hcr_memory-0.5.0/hcr/product/config.py +219 -0
  177. hcr_memory-0.5.0/hcr/product/core/__init__.py +3 -0
  178. hcr_memory-0.5.0/hcr/product/core/hook_health.py +124 -0
  179. hcr_memory-0.5.0/hcr/product/daemon/__init__.py +4 -0
  180. hcr_memory-0.5.0/hcr/product/daemon/__main__.py +19 -0
  181. hcr_memory-0.5.0/hcr/product/daemon/git_hooks.py +93 -0
  182. hcr_memory-0.5.0/hcr/product/daemon/terminal_logger.py +220 -0
  183. hcr_memory-0.5.0/hcr/product/git_history_seeder.py +443 -0
  184. hcr_memory-0.5.0/hcr/product/git_hook_trigger.py +262 -0
  185. hcr_memory-0.5.0/hcr/product/hooks/__init__.py +2 -0
  186. hcr_memory-0.5.0/hcr/product/hooks/claude_code.py +267 -0
  187. hcr_memory-0.5.0/hcr/product/hooks/installer.py +119 -0
  188. hcr_memory-0.5.0/hcr/product/integrations/__init__.py +2 -0
  189. hcr_memory-0.5.0/hcr/product/integrations/config.py +204 -0
  190. hcr_memory-0.5.0/hcr/product/integrations/mcp_server.py +3781 -0
  191. hcr_memory-0.5.0/hcr/product/integrations/mcp_server_stdio.py +123 -0
  192. hcr_memory-0.5.0/hcr/product/integrations/prometheus_metrics.py +380 -0
  193. hcr_memory-0.5.0/hcr/product/integrations/request_context.py +43 -0
  194. hcr_memory-0.5.0/hcr/product/integrations/telemetry_client.py +87 -0
  195. hcr_memory-0.5.0/hcr/product/integrations/tools/__init__.py +65 -0
  196. hcr_memory-0.5.0/hcr/product/integrations/tools/agent_tools.py +720 -0
  197. hcr_memory-0.5.0/hcr/product/integrations/tools/base_tool.py +202 -0
  198. hcr_memory-0.5.0/hcr/product/integrations/tools/ccr_tool.py +23 -0
  199. hcr_memory-0.5.0/hcr/product/integrations/tools/context_tools.py +191 -0
  200. hcr_memory-0.5.0/hcr/product/integrations/tools/coverage_tool.py +58 -0
  201. hcr_memory-0.5.0/hcr/product/integrations/tools/cso_tools.py +95 -0
  202. hcr_memory-0.5.0/hcr/product/integrations/tools/decision_tools.py +421 -0
  203. hcr_memory-0.5.0/hcr/product/integrations/tools/file_tools.py +197 -0
  204. hcr_memory-0.5.0/hcr/product/integrations/tools/health_tools.py +113 -0
  205. hcr_memory-0.5.0/hcr/product/integrations/tools/impact_tools.py +174 -0
  206. hcr_memory-0.5.0/hcr/product/integrations/tools/operator_tools.py +41 -0
  207. hcr_memory-0.5.0/hcr/product/integrations/tools/output_synthesizer.py +781 -0
  208. hcr_memory-0.5.0/hcr/product/integrations/tools/recommendation_tools.py +99 -0
  209. hcr_memory-0.5.0/hcr/product/integrations/tools/risk_tools.py +82 -0
  210. hcr_memory-0.5.0/hcr/product/integrations/tools/search_tools.py +349 -0
  211. hcr_memory-0.5.0/hcr/product/integrations/tools/session_tools.py +354 -0
  212. hcr_memory-0.5.0/hcr/product/integrations/tools/shared_state_tools.py +145 -0
  213. hcr_memory-0.5.0/hcr/product/integrations/tools/state_tools.py +393 -0
  214. hcr_memory-0.5.0/hcr/product/integrations/tools/task_tools.py +158 -0
  215. hcr_memory-0.5.0/hcr/product/integrations/tools/telemetry_tools.py +226 -0
  216. hcr_memory-0.5.0/hcr/product/integrations/tools/trigger_tools.py +66 -0
  217. hcr_memory-0.5.0/hcr/product/integrations/tools/version_tools.py +144 -0
  218. hcr_memory-0.5.0/hcr/product/integrations/tools/why_tools.py +99 -0
  219. hcr_memory-0.5.0/hcr/product/integrations/transport.py +72 -0
  220. hcr_memory-0.5.0/hcr/product/proxy/__init__.py +2 -0
  221. hcr_memory-0.5.0/hcr/product/proxy/interceptor.py +132 -0
  222. hcr_memory-0.5.0/hcr/product/security/__init__.py +2 -0
  223. hcr_memory-0.5.0/hcr/product/security/policy_manager.py +147 -0
  224. hcr_memory-0.5.0/hcr/product/server/__init__.py +3 -0
  225. hcr_memory-0.5.0/hcr/product/state_capture/__init__.py +7 -0
  226. hcr_memory-0.5.0/hcr/product/state_capture/file_watcher.py +353 -0
  227. hcr_memory-0.5.0/hcr/product/state_capture/git_tracker.py +145 -0
  228. hcr_memory-0.5.0/hcr/product/storage/__init__.py +6 -0
  229. hcr_memory-0.5.0/hcr/product/storage/decisions_reader.py +56 -0
  230. hcr_memory-0.5.0/hcr/product/storage/provenance.py +252 -0
  231. hcr_memory-0.5.0/hcr/product/storage/semantic_decay.py +224 -0
  232. hcr_memory-0.5.0/hcr/product/storage/state_persistence.py +661 -0
  233. hcr_memory-0.5.0/hcr/product/storage/state_transaction.py +113 -0
  234. hcr_memory-0.5.0/hcr/product/sync/__init__.py +2 -0
  235. hcr_memory-0.5.0/hcr/product/sync/outbox.py +77 -0
  236. hcr_memory-0.5.0/hcr_memory.egg-info/PKG-INFO +632 -0
  237. hcr_memory-0.5.0/hcr_memory.egg-info/SOURCES.txt +365 -0
  238. hcr_memory-0.5.0/hcr_memory.egg-info/dependency_links.txt +1 -0
  239. hcr_memory-0.5.0/hcr_memory.egg-info/entry_points.txt +3 -0
  240. hcr_memory-0.5.0/hcr_memory.egg-info/requires.txt +32 -0
  241. hcr_memory-0.5.0/hcr_memory.egg-info/top_level.txt +1 -0
  242. hcr_memory-0.5.0/pyproject.toml +83 -0
  243. hcr_memory-0.5.0/setup.cfg +4 -0
  244. hcr_memory-0.5.0/tests/test_agent_governance.py +199 -0
  245. hcr_memory-0.5.0/tests/test_agent_registry.py +54 -0
  246. hcr_memory-0.5.0/tests/test_all_mcp_tools.py +138 -0
  247. hcr_memory-0.5.0/tests/test_api_apikeys.py +68 -0
  248. hcr_memory-0.5.0/tests/test_api_auth.py +99 -0
  249. hcr_memory-0.5.0/tests/test_api_cpap_stats.py +90 -0
  250. hcr_memory-0.5.0/tests/test_api_csos.py +126 -0
  251. hcr_memory-0.5.0/tests/test_api_memory.py +90 -0
  252. hcr_memory-0.5.0/tests/test_api_teams.py +357 -0
  253. hcr_memory-0.5.0/tests/test_api_telemetry.py +34 -0
  254. hcr_memory-0.5.0/tests/test_auth_bypass.py +76 -0
  255. hcr_memory-0.5.0/tests/test_auto_init.py +169 -0
  256. hcr_memory-0.5.0/tests/test_cache.py +61 -0
  257. hcr_memory-0.5.0/tests/test_causal.py +113 -0
  258. hcr_memory-0.5.0/tests/test_ccr.py +208 -0
  259. hcr_memory-0.5.0/tests/test_centrality.py +48 -0
  260. hcr_memory-0.5.0/tests/test_centrality_decay.py +20 -0
  261. hcr_memory-0.5.0/tests/test_circuit_breaker.py +84 -0
  262. hcr_memory-0.5.0/tests/test_claude_md_injection.py +25 -0
  263. hcr_memory-0.5.0/tests/test_cli_team_sync.py +260 -0
  264. hcr_memory-0.5.0/tests/test_co_change_miner.py +220 -0
  265. hcr_memory-0.5.0/tests/test_cognitive_projection_wire.py +104 -0
  266. hcr_memory-0.5.0/tests/test_commit_extractor.py +51 -0
  267. hcr_memory-0.5.0/tests/test_config.py +52 -0
  268. hcr_memory-0.5.0/tests/test_constraint_propagation.py +261 -0
  269. hcr_memory-0.5.0/tests/test_coverage_signal.py +194 -0
  270. hcr_memory-0.5.0/tests/test_cpap.py +286 -0
  271. hcr_memory-0.5.0/tests/test_cso_impact.py +65 -0
  272. hcr_memory-0.5.0/tests/test_cso_impact_semantic.py +86 -0
  273. hcr_memory-0.5.0/tests/test_cso_migrator.py +47 -0
  274. hcr_memory-0.5.0/tests/test_cso_model.py +52 -0
  275. hcr_memory-0.5.0/tests/test_cso_serializers.py +364 -0
  276. hcr_memory-0.5.0/tests/test_cso_store.py +271 -0
  277. hcr_memory-0.5.0/tests/test_cso_tools.py +244 -0
  278. hcr_memory-0.5.0/tests/test_daemon.py +94 -0
  279. hcr_memory-0.5.0/tests/test_decision_tools.py +217 -0
  280. hcr_memory-0.5.0/tests/test_decisions_reader.py +34 -0
  281. hcr_memory-0.5.0/tests/test_dedup_supersedence.py +384 -0
  282. hcr_memory-0.5.0/tests/test_e2e_core_promise.py +186 -0
  283. hcr_memory-0.5.0/tests/test_embed_tiers.py +132 -0
  284. hcr_memory-0.5.0/tests/test_embedding_store.py +113 -0
  285. hcr_memory-0.5.0/tests/test_embedding_sync.py +88 -0
  286. hcr_memory-0.5.0/tests/test_encoding_fix.py +22 -0
  287. hcr_memory-0.5.0/tests/test_engine_api_extra.py +209 -0
  288. hcr_memory-0.5.0/tests/test_engine_api_extract_task.py +88 -0
  289. hcr_memory-0.5.0/tests/test_engine_init.py +22 -0
  290. hcr_memory-0.5.0/tests/test_feedback.py +209 -0
  291. hcr_memory-0.5.0/tests/test_feedback_reset.py +61 -0
  292. hcr_memory-0.5.0/tests/test_fusion.py +70 -0
  293. hcr_memory-0.5.0/tests/test_fusion_mmr_parity.py +91 -0
  294. hcr_memory-0.5.0/tests/test_get_csos_by_scope.py +133 -0
  295. hcr_memory-0.5.0/tests/test_git_history_seeder.py +102 -0
  296. hcr_memory-0.5.0/tests/test_git_hooks.py +16 -0
  297. hcr_memory-0.5.0/tests/test_git_ingestion.py +307 -0
  298. hcr_memory-0.5.0/tests/test_groq_direct.py +60 -0
  299. hcr_memory-0.5.0/tests/test_hcr_search_tool.py +108 -0
  300. hcr_memory-0.5.0/tests/test_hooks_integration.py +238 -0
  301. hcr_memory-0.5.0/tests/test_hyde.py +132 -0
  302. hcr_memory-0.5.0/tests/test_implicit_graph.py +46 -0
  303. hcr_memory-0.5.0/tests/test_inference.py +331 -0
  304. hcr_memory-0.5.0/tests/test_inference_benchmark.py +100 -0
  305. hcr_memory-0.5.0/tests/test_init_seeding.py +63 -0
  306. hcr_memory-0.5.0/tests/test_install_command.py +184 -0
  307. hcr_memory-0.5.0/tests/test_integration_cross_tool.py +91 -0
  308. hcr_memory-0.5.0/tests/test_llm_provider.py +259 -0
  309. hcr_memory-0.5.0/tests/test_llm_provider_comparison.py +280 -0
  310. hcr_memory-0.5.0/tests/test_mcp_auth.py +34 -0
  311. hcr_memory-0.5.0/tests/test_mcp_e2e_report.py +242 -0
  312. hcr_memory-0.5.0/tests/test_mcp_init.py +58 -0
  313. hcr_memory-0.5.0/tests/test_mcp_init2.py +25 -0
  314. hcr_memory-0.5.0/tests/test_mcp_inject.py +14 -0
  315. hcr_memory-0.5.0/tests/test_mcp_server_init.py +98 -0
  316. hcr_memory-0.5.0/tests/test_mcp_stdio_auth.py +71 -0
  317. hcr_memory-0.5.0/tests/test_mcp_stdio_e2e.py +193 -0
  318. hcr_memory-0.5.0/tests/test_mcp_tools.py +49 -0
  319. hcr_memory-0.5.0/tests/test_onboarding.py +122 -0
  320. hcr_memory-0.5.0/tests/test_optimizations.py +50 -0
  321. hcr_memory-0.5.0/tests/test_outbox.py +92 -0
  322. hcr_memory-0.5.0/tests/test_plan21_critical.py +183 -0
  323. hcr_memory-0.5.0/tests/test_policy_manager.py +233 -0
  324. hcr_memory-0.5.0/tests/test_prefetch.py +71 -0
  325. hcr_memory-0.5.0/tests/test_preflight.py +53 -0
  326. hcr_memory-0.5.0/tests/test_preflight_centrality.py +98 -0
  327. hcr_memory-0.5.0/tests/test_preflight_cpap_channel_ranks.py +71 -0
  328. hcr_memory-0.5.0/tests/test_project_id_unification.py +36 -0
  329. hcr_memory-0.5.0/tests/test_projection.py +87 -0
  330. hcr_memory-0.5.0/tests/test_projection_priority.py +97 -0
  331. hcr_memory-0.5.0/tests/test_prospective.py +124 -0
  332. hcr_memory-0.5.0/tests/test_provenance.py +186 -0
  333. hcr_memory-0.5.0/tests/test_proxy_interceptor.py +153 -0
  334. hcr_memory-0.5.0/tests/test_rate_limit.py +41 -0
  335. hcr_memory-0.5.0/tests/test_rehearsal_decay.py +244 -0
  336. hcr_memory-0.5.0/tests/test_reranker.py +25 -0
  337. hcr_memory-0.5.0/tests/test_resolve_tool.py +48 -0
  338. hcr_memory-0.5.0/tests/test_resume_decisions.py +39 -0
  339. hcr_memory-0.5.0/tests/test_rollback_cso.py +103 -0
  340. hcr_memory-0.5.0/tests/test_save_state.py +36 -0
  341. hcr_memory-0.5.0/tests/test_scrutiny_adversarial.py +172 -0
  342. hcr_memory-0.5.0/tests/test_scrutiny_continuity.py +149 -0
  343. hcr_memory-0.5.0/tests/test_scrutiny_cross_project.py +148 -0
  344. hcr_memory-0.5.0/tests/test_scrutiny_retrieval.py +185 -0
  345. hcr_memory-0.5.0/tests/test_seed_docs_cli.py +150 -0
  346. hcr_memory-0.5.0/tests/test_semantic_decay.py +67 -0
  347. hcr_memory-0.5.0/tests/test_session_miner.py +211 -0
  348. hcr_memory-0.5.0/tests/test_sse_notify.py +59 -0
  349. hcr_memory-0.5.0/tests/test_sse_stream.py +263 -0
  350. hcr_memory-0.5.0/tests/test_state.py +56 -0
  351. hcr_memory-0.5.0/tests/test_state_api.py +124 -0
  352. hcr_memory-0.5.0/tests/test_state_merger.py +314 -0
  353. hcr_memory-0.5.0/tests/test_state_tools_enrichment.py +148 -0
  354. hcr_memory-0.5.0/tests/test_symbolic.py +53 -0
  355. hcr_memory-0.5.0/tests/test_symbolic_verifier.py +86 -0
  356. hcr_memory-0.5.0/tests/test_sync.py +17 -0
  357. hcr_memory-0.5.0/tests/test_sync_pull.py +110 -0
  358. hcr_memory-0.5.0/tests/test_synthesizer.py +16 -0
  359. hcr_memory-0.5.0/tests/test_telemetry_client.py +78 -0
  360. hcr_memory-0.5.0/tests/test_temporal_channel.py +234 -0
  361. hcr_memory-0.5.0/tests/test_temporal_correlator.py +388 -0
  362. hcr_memory-0.5.0/tests/test_token_store.py +150 -0
  363. hcr_memory-0.5.0/tests/test_token_store_apikey.py +37 -0
  364. hcr_memory-0.5.0/tests/test_tool_input_validation.py +46 -0
  365. hcr_memory-0.5.0/tests/test_transport.py +227 -0
  366. hcr_memory-0.5.0/tests/test_verbosity.py +290 -0
  367. hcr_memory-0.5.0/tests/test_write_batch.py +213 -0
@@ -0,0 +1,6 @@
1
+ Copyright (c) 2025-2026 Rishi Praseeth Krishnan. All rights reserved.
2
+
3
+ This software is proprietary and confidential. Unauthorized copying, modification,
4
+ distribution, or use of this software, via any medium, is strictly prohibited.
5
+
6
+ For licensing inquiries, contact: praseethintegra@gmail.com
@@ -0,0 +1,11 @@
1
+ include LICENSE
2
+ include README.md
3
+ include pyproject.toml
4
+ recursive-include hcr *.json *.yaml *.yml *.md
5
+ recursive-include docs *.md
6
+ exclude .env
7
+ exclude .env.*
8
+ prune .hcr
9
+ prune .claude
10
+ prune demo
11
+ prune benchmark
@@ -0,0 +1,632 @@
1
+ Metadata-Version: 2.4
2
+ Name: hcr-memory
3
+ Version: 0.5.0
4
+ Summary: Persistent developer memory layer for AI coding tools — decisions, context, and knowledge that survive across sessions
5
+ Author-email: Rishi Praseeth Krishnan <praseethintegra@gmail.com>
6
+ License: Proprietary
7
+ Project-URL: Homepage, https://github.com/PantheraLabs/HybridCognitiveRuntime
8
+ Project-URL: Repository, https://github.com/PantheraLabs/HybridCognitiveRuntime
9
+ Project-URL: Documentation, https://github.com/PantheraLabs/HybridCognitiveRuntime#readme
10
+ Project-URL: Issues, https://github.com/PantheraLabs/HybridCognitiveRuntime/issues
11
+ Keywords: mcp,ai,context,developer-tools,cursor,claude-code,windsurf,memory,cognitive
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: rich>=13.0.0
24
+ Requires-Dist: pyyaml>=6.0
25
+ Requires-Dist: python-dotenv>=1.0.0
26
+ Requires-Dist: requests>=2.28.0
27
+ Requires-Dist: pyjwt>=2.8.0
28
+ Requires-Dist: httpx>=0.27.0
29
+ Provides-Extra: server
30
+ Requires-Dist: fastapi>=0.111.0; extra == "server"
31
+ Requires-Dist: uvicorn[standard]>=0.29.0; extra == "server"
32
+ Requires-Dist: aiohttp>=3.9.0; extra == "server"
33
+ Requires-Dist: cryptography>=41.0.0; extra == "server"
34
+ Requires-Dist: supabase>=2.0.0; extra == "server"
35
+ Provides-Extra: embeddings
36
+ Requires-Dist: sqlite-vec>=0.1.0; extra == "embeddings"
37
+ Requires-Dist: numpy>=1.24.0; extra == "embeddings"
38
+ Requires-Dist: sentence-transformers>=2.2.0; extra == "embeddings"
39
+ Requires-Dist: cross-encoder>=0.0.1; extra == "embeddings"
40
+ Provides-Extra: google
41
+ Requires-Dist: google-genai>=1.0.0; extra == "google"
42
+ Provides-Extra: all
43
+ Requires-Dist: hcr-memory[server]; extra == "all"
44
+ Requires-Dist: hcr-memory[embeddings]; extra == "all"
45
+ Requires-Dist: hcr-memory[google]; extra == "all"
46
+ Provides-Extra: dev
47
+ Requires-Dist: pytest; extra == "dev"
48
+ Requires-Dist: pytest-asyncio; extra == "dev"
49
+ Requires-Dist: hcr-memory[all]; extra == "dev"
50
+ Dynamic: license-file
51
+
52
+ <div align="center">
53
+ <img src="assets/images/logo.png" alt="HCR Logo" width="200"/>
54
+ <h1>Hybrid Cognitive Runtime (HCR)</h1>
55
+ <p><strong>The Brain Behind Your AI Assistant</strong></p>
56
+ <p>Enterprise-grade state management infrastructure for AI-powered development tools</p>
57
+ <p>
58
+ <a href="#quick-start"><img src="https://img.shields.io/badge/python-3.10+-blue.svg" alt="Python 3.8+"></a>
59
+ <a href="#enterprise-features"><img src="https://img.shields.io/badge/enterprise-ready-success.svg" alt="Enterprise Ready"></a>
60
+ <a href="#security"><img src="https://img.shields.io/badge/security-RBAC%20%7C%20Audit%20%7C%20Compliance-brightgreen.svg" alt="Security"></a>
61
+ <a href="#integrations"><img src="https://img.shields.io/badge/MCP-Universal%20IDE%20Integration-purple.svg" alt="MCP"></a>
62
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-Proprietary-red.svg" alt="License: Proprietary"></a>
63
+ </p>
64
+ </div>
65
+
66
+ ---
67
+
68
+ ## Overview
69
+
70
+ **Hybrid Cognitive Runtime (HCR)** is a state-based cognitive execution system that eliminates the #1 developer pain point: **context loss**.
71
+
72
+ Traditional AI assistants are stateless—every session starts from zero, requiring developers to spend 10+ minutes re-explaining their work. HCR solves this by making intelligence persistent through structured cognitive state.
73
+
74
+ ### The Problem
75
+
76
+ - **48% of AI-generated code has security vulnerabilities** due to context gaps
77
+ - Developers waste **10+ minutes per session** rebuilding context
78
+ - AI assistants have **no memory** across sessions, devices, or conversations
79
+ - Enterprise teams lack **audit trails** and **context governance**
80
+
81
+ ### The Solution
82
+
83
+ HCR provides a persistent cognitive state layer that:
84
+ - **Remembers** context across sessions, models, and projects
85
+ - **Reduces token usage** by 10-100x (2000 → 200 tokens)
86
+ - **Enables instant resume** in <10 seconds
87
+ - **Provides enterprise governance** with audit trails and RBAC
88
+
89
+ ### Value Proposition
90
+
91
+ | Metric | Traditional AI | HCR |
92
+ |--------|----------------|-----|
93
+ | Context Rebuild Time | 10+ minutes | <10 seconds |
94
+ | Token Usage per Session | 2000+ tokens | 200 tokens |
95
+ | Sessions Without Re-Explanation | 0% | >80% |
96
+ | Cross-Session Memory | ❌ None | ✅ Full |
97
+ | Enterprise Governance | ❌ Limited | ✅ RBAC + Audit |
98
+
99
+ ---
100
+
101
+ ## Enterprise Features
102
+
103
+ ### Resume Without Re-Explaining
104
+ Our flagship feature that eliminates context re-explanation overhead.
105
+
106
+ - **Instant Context Recovery**: Resume work in <10 seconds after any time gap
107
+ - **Intelligent Task Inference**: Automatically detect what you were working on
108
+ - **Progress Tracking**: Know exactly how far you got before the break
109
+ - **Smart Suggestions**: AI-powered next action recommendations
110
+
111
+ ### State Persistence
112
+ Enterprise-grade state management with Git-like versioning.
113
+
114
+ - **Git-like Versioning**: State hashes, commit messages, parent references
115
+ - **Compression**: gzip compression for efficient storage
116
+ - **Encryption**: Enterprise encryption for sensitive state data
117
+ - **Cross-Project State**: Share cognitive state across multiple projects
118
+ - **Thread-Safe Operations**: Lock-based concurrent access support
119
+
120
+ ### Security & Governance
121
+ Built for enterprise security and compliance requirements.
122
+
123
+ - **Role-Based Access Control (RBAC)**: Developer, Admin, Auditor, Service roles
124
+ - **Granular Permissions**: READ_STATE, WRITE_STATE, DELETE_STATE, VIEW_AUDIT_LOG
125
+ - **Audit Logging**: Complete audit trail with query capabilities
126
+ - **Compliance Reporting**: GDPR, SOC2, HIPAA, ISO27001 checks
127
+ - **User Management**: Create, authenticate, authorize users
128
+
129
+ ### MCP Integration
130
+ Universal IDE integration through Model Context Protocol.
131
+
132
+ - **32 MCP Tools**: Full state management, causal graph analysis, task inference, session management, version control, search, recommendations, agent lifecycle (preflight/postflight), triggers, shared state, and more
133
+ - **3 MCP Resources**: State, causal-graph, task endpoints
134
+ - **2 MCP Prompts**: Resume session, context-aware coding
135
+ - **Dual Transport**: Stdio (Claude/Cursor/Windsurf) + HTTP (web)
136
+ - **Commercial Ready Architecture**: Asyncio, non-blocking, full concurrency
137
+
138
+ ### Web Dashboard
139
+ Real-time state visualization and monitoring.
140
+
141
+ - **Live Metrics**: Token efficiency, confidence, uncertainty, active states
142
+ - **Causal Graph Visualization**: Interactive ReactFlow with animated edges
143
+ - **State Evolution Timeline**: Git-like version history browser
144
+ - **System Health Monitor**: Component health dashboard
145
+ - **Risk Heatmaps**: Fragility scoring and centrality analysis
146
+
147
+ ---
148
+
149
+ ## Architecture
150
+
151
+ ### Cognitive State Fabric (CSF) — v2.0
152
+
153
+ The intelligence layer powering HCR's memory:
154
+
155
+ | Layer | Component | What it does |
156
+ |-------|-----------|-------------|
157
+ | Storage | `CSOStore` (SQLite + WAL) | Causally-linked CSO records, indexed by type/scope |
158
+ | Embedding | `EmbeddingStore` (sqlite-vec) | ANN vector search via Ollama or sentence-transformers |
159
+ | Centrality | `CausalCentralityScorer` | BFS reachability scoring — high-impact CSOs decay slower |
160
+ | Projection | `CognitiveProjection` | Centrality-ranked, decay-filtered live state for each agent call |
161
+ | Soft links | `generate_soft_links` | Semantic k-NN auto-detects implicit causal edges (threshold 0.82) |
162
+ | Episodes | `BOCPDSegmenter` | Bayesian changepoint detection segments event streams into work sessions |
163
+ | Fusion | `reciprocal_rank_fusion` + `mmr_select` | Merges semantic + causal results; selects diverse top-k |
164
+ | Prospective | `prospective.py` | TRIGGER CSOs inject reminders when matching file is edited (5th memory type) |
165
+ | Learned fusion | `FeedbackStore` | Learns RRF weights from agent session outcomes via least-squares |
166
+
167
+ ### Core Components (Legacy / Low-Level)
168
+
169
+ #### Hybrid Cognitive Operator (HCO)
170
+ The fundamental unit of reasoning in HCR.
171
+
172
+ An HCO is the smallest executable unit of reasoning.
173
+
174
+ ```
175
+ HCO = (
176
+ S_in, # input cognitive state
177
+ Φ_n, # neural operator (handles ambiguity)
178
+ Φ_s, # symbolic operator (rules / logic)
179
+ Φ_c, # causal operator (dependencies)
180
+ Π, # policy selector
181
+ ΔS # state transition
182
+ )
183
+ ```
184
+
185
+ #### Cognitive State (S)
186
+ Rich, multi-modal state representation.
187
+
188
+ ```python
189
+ S = {
190
+ latent: vector(n), # compressed representation
191
+ symbolic: {
192
+ facts: [],
193
+ rules: [],
194
+ constraints: []
195
+ },
196
+ causal: {
197
+ dependencies: [],
198
+ effects: []
199
+ },
200
+ meta: {
201
+ confidence: float,
202
+ uncertainty: float,
203
+ timestamp: t
204
+ }
205
+ }
206
+ ```
207
+
208
+ ### System Architecture
209
+
210
+ ```
211
+ ┌─────────────────────────────────────────────────────────┐
212
+ │ Hybrid Cognitive Runtime │
213
+ ├─────────────────────────────────────────────────────────┤
214
+ │ │
215
+ │ ┌──────────────┐ ┌──────────────┐ │
216
+ │ │ Input State │─────▶│ HCO Engine │ │
217
+ │ │ (S_in) │ │ │ │
218
+ │ └──────────────┘ └──────┬───────┘ │
219
+ │ │ │
220
+ │ ▼ │
221
+ │ ┌──────────────┐ │
222
+ │ │ Policy (Π) │ │
223
+ │ └──────┬───────┘ │
224
+ │ │ │
225
+ │ ┌────────────────┼────────────────┐ │
226
+ │ ▼ ▼ ▼ │
227
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
228
+ │ │ Neural │ │Symbolic │ │ Causal │ │
229
+ │ │ (Φ_n) │ │ (Φ_s) │ │ (Φ_c) │ │
230
+ │ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
231
+ │ │ │ │ │
232
+ │ └──────────────┼──────────────┘ │
233
+ │ │ │
234
+ │ ▼ │
235
+ │ ┌──────────┐ │
236
+ │ │ ΔS (State │ │
237
+ │ │Transition)│ │
238
+ │ └────┬─────┘ │
239
+ │ │ │
240
+ │ ▼ │
241
+ │ ┌──────────────┐ │
242
+ │ │ Output State │ │
243
+ │ │ (S_next) │ │
244
+ │ └──────────────┘ │
245
+ │ │
246
+ ├─────────────────────────────────────────────────┤
247
+ │ Operator Registry & Storage │
248
+ ├─────────────────────────────────────────────────┤
249
+ │ • HCO Catalog • State History │
250
+ │ • Operator Sequences • Learning Metrics │
251
+ │ • Performance Data • Feedback Loops │
252
+ └─────────────────────────────────────────────────┘
253
+ ```
254
+
255
+ ## Getting Started
256
+
257
+ ### 1. Install
258
+
259
+ ```bash
260
+ pip install hcr-mcp
261
+ hcr init # creates .hcr/ in your project
262
+ hcr auth login # authenticate (opens browser) — optional, see Local-only below
263
+ ```
264
+
265
+ > Requires Python 3.10+.
266
+
267
+ **Full retrieval stack** (embeddings + reranker, ~500 MB first run):
268
+ ```bash
269
+ pip install "hcr-mcp[embeddings]"
270
+ ```
271
+
272
+ **Local-only mode** — no account needed:
273
+ ```bash
274
+ pip install hcr-mcp
275
+ hcr init
276
+ hcr-mcp # starts stdio server, no auth required
277
+ ```
278
+
279
+ ### 2. Add to your IDE
280
+
281
+ Add to `.mcp.json` (Claude Code / Cursor / Windsurf / any MCP-compatible IDE):
282
+
283
+ ```json
284
+ {
285
+ "mcpServers": {
286
+ "hcr": {
287
+ "command": "hcr-mcp",
288
+ "args": []
289
+ }
290
+ }
291
+ }
292
+ ```
293
+
294
+ Restart your IDE. `hcr_preflight` will now appear in your AI tool list.
295
+
296
+ **Minimum requirements:** Python 3.10+, 50 MB disk (base), 550 MB (with embeddings). No Docker, no Redis, no external DB.
297
+
298
+ ### 3. Use with your AI tool
299
+
300
+ HCR works via MCP — no code changes needed. After `hcr init`, restart your IDE. The AI assistant now has access to `hcr_preflight`, `hcr_remember`, and the full memory tool suite.
301
+
302
+ ```bash
303
+ # Check everything is working
304
+ hcr status
305
+
306
+ # Resume context after a break
307
+ hcr resume
308
+ ```
309
+
310
+ ### Troubleshooting
311
+
312
+ | Problem | Fix |
313
+ |---------|-----|
314
+ | `hcr: command not found` | Restart terminal or run `pip show hcr-mcp` to verify install |
315
+ | MCP tools not showing | Restart IDE after `hcr init` |
316
+ | Embedding errors | Run `pip install -e ".[embeddings]"` for semantic search |
317
+
318
+ ---
319
+
320
+ ## Installation (Advanced)
321
+
322
+ ### Development install from source
323
+
324
+ ```bash
325
+ git clone https://github.com/PantheraLabs/HybridCognitiveRuntime.git
326
+ cd HybridCognitiveRuntime
327
+ pip install -e .
328
+ ```
329
+
330
+ > **With semantic search:** `pip install -e ".[embeddings]"`
331
+
332
+ ### First-time setup
333
+
334
+ ```bash
335
+ hcr login # Authenticate (opens browser for cloud features)
336
+ hcr init --auto # Initialize project + wire up IDE
337
+ ```
338
+
339
+ ## Quick Start
340
+
341
+ ### Resume Your Session
342
+
343
+ ```bash
344
+ # Resume with context
345
+ hcr resume
346
+
347
+ # Check system status
348
+ hcr status
349
+
350
+ # Launch web dashboard
351
+ hcr dashboard
352
+ ```
353
+
354
+ ### Using the Engine API
355
+
356
+ ```python
357
+ from hcr.engine.engine_api import HCREngine, EngineEvent
358
+
359
+ # Initialize engine
360
+ engine = HCREngine(project_path=".")
361
+
362
+ # Process an event
363
+ engine.update_from_environment(EngineEvent(
364
+ event_type="file_edit",
365
+ data={"path": "src/core/hco_engine.py"}
366
+ ))
367
+
368
+ # Infer context using real LLM intelligence
369
+ context = engine.infer_context()
370
+ print(f"Task: {context.current_task}")
371
+ print(f"Next Action: {context.next_action}")
372
+ ```
373
+
374
+ ### IDE Integration
375
+
376
+ HCR integrates with your IDE via MCP (Model Context Protocol):
377
+
378
+ - **Windsurf/Cascade**: Automatic context capture and resume
379
+ - **Claude Desktop**: Native HCR tools available
380
+ - **Cursor**: Full MCP server integration
381
+ - **VS Code**: Extension available (coming soon)
382
+
383
+ Configure your IDE's MCP settings using the CLI (e.g. `hcr setup-ide --auto`), or point to:
384
+ ```
385
+ command: python -m hcr.product.integrations.mcp_server_stdio
386
+ ```
387
+
388
+ ## Security & Compliance
389
+
390
+ ### Security Features
391
+
392
+ - **RBAC**: Role-based access control with granular permissions
393
+ - **Audit Logging**: Complete audit trail of all state operations
394
+ - **Encryption**: State data encryption at rest and in transit
395
+ - **Authentication**: Secure user authentication and authorization
396
+ - **Data Isolation**: Project-level state isolation
397
+
398
+ ### Compliance Standards
399
+
400
+ - **GDPR**: Data protection and privacy compliance
401
+ - **SOC2**: Security and availability controls
402
+ - **HIPAA**: Healthcare data protection (enterprise tier)
403
+ - **ISO27001**: Information security management
404
+
405
+ ### Data Privacy
406
+
407
+ - All cognitive state data remains under your control
408
+ - Optional local-only mode with no external data transmission
409
+ - Configurable data retention policies
410
+ - Export capabilities for data portability
411
+
412
+ ---
413
+
414
+ ## Testing & Quality
415
+
416
+ ```bash
417
+ # Run full test suite
418
+ python -m pytest tests/ -v
419
+
420
+ # Run specific test
421
+ python -m pytest tests/test_engine_api.py -v
422
+
423
+ # System diagnostics
424
+ hcr doctor
425
+ hcr doctor --format json
426
+ ```
427
+
428
+ **Test Coverage:** 384 tests passing, 6 skipped (100% pass rate)
429
+
430
+ **Quality Metrics:**
431
+ - Code coverage: >90%
432
+ - Integration tests: Full MCP server verification (24 tools)
433
+ - Performance benchmarks: Token efficiency validated
434
+ - Security audit: B+ grade (see `docs/CODE_REVIEW_2026_04_28.md`)
435
+
436
+ ## Project Structure
437
+
438
+ ```
439
+ HybridCognitiveRuntime/
440
+ ├── src/
441
+ │ ├── state/ # State representation & transitions
442
+ │ ├── operators/ # HCO implementations (Neural, Symbolic, Causal)
443
+ │ ├── core/ # Execution engine & orchestration
444
+ │ ├── llm/ # LLM Provider abstraction
445
+ │ ├── causal/ # Causal graph & dependency analysis
446
+ │ └── engine_api.py # High-level product API
447
+ ├── product/
448
+ │ ├── config.py # Layered configuration system
449
+ │ ├── caching/ # LLM request cache
450
+ │ ├── server/ # HTTP engine API server
451
+ │ ├── cli/ # Professional CLI (init, resume, status, dashboard)
452
+ │ ├── state_capture/ # Git tracker, file watcher, terminal monitor
453
+ │ ├── storage/ # State persistence, locking, semantic decay
454
+ │ ├── hco_wrappers/ # Developer context HCOs
455
+ │ ├── integrations/ # MCP server, IDE bridges
456
+ │ ├── security/ # RBAC, audit logging, compliance
457
+ │ └── daemon/ # Git hook triggers & watchers
458
+ ├── web/
459
+ │ └── web-ui/ # React dashboard with ReactFlow visualization
460
+ ├── examples/ # Usage examples
461
+ ├── tests/ # Unit tests & benchmarks
462
+ └── docs/ # Documentation
463
+ ├── project_memory.md # Project decisions & context
464
+ ├── architecture.md # System architecture
465
+ ├── tasks.md # Development roadmap
466
+ └── dev_log.md # Development log
467
+ ```
468
+
469
+ ## Key Features
470
+
471
+ ### Core Capabilities
472
+ - **Real Intelligence**: Integrated with Groq, Gemini, Ollama, OpenAI, and Anthropic
473
+ - **State-Based Reasoning**: Persistent cognitive state across operations
474
+ - **Zero-Latency Processing**: Events processed instantly; LLM called lazily
475
+ - **Heuristic Fallback**: Works offline/without keys using pattern matching
476
+ - **Response Caching**: Hash-based caching to minimize LLM costs
477
+
478
+ ### Developer Experience
479
+ - **One-Command Setup**: `hcr init --auto` configures everything automatically
480
+ - **Universal IDE Support**: MCP integration for Windsurf, Claude, Cursor
481
+ - **Professional CLI**: Intuitive commands for all operations
482
+ - **Web Dashboard**: Real-time state visualization and monitoring
483
+ - **Smart Resume**: Context recovery in <10 seconds
484
+
485
+ ### Enterprise Features
486
+ - **RBAC**: Role-based access control with granular permissions
487
+ - **Audit Logging**: Complete audit trail for compliance
488
+ - **State Versioning**: Git-like state history and rollback
489
+ - **Cross-Project State**: Share cognitive state across projects
490
+ - **Compliance Reporting**: GDPR, SOC2, HIPAA, ISO27001
491
+
492
+ ## Why HCR?
493
+
494
+ ### The Problem
495
+
496
+ Developer tools today force you to **re-explain your context** every time you switch windows, devices, or conversations:
497
+
498
+ - VS Code doesn't remember what you were doing
499
+ - AI assistants start fresh every chat
500
+ - Context is lost across sessions
501
+ - **48% of AI-generated code has security vulnerabilities** due to context gaps
502
+ - Developers waste **10+ minutes per session** rebuilding context
503
+
504
+ ### The Solution
505
+
506
+ HCR captures and persists **cognitive state** — not just files, but *what you were thinking*:
507
+
508
+ ```
509
+ Developer opens project
510
+
511
+ System loads saved cognitive state from .hcr/state/
512
+
513
+ Captures current context (git diff, open files, errors)
514
+
515
+ Updates cognitive state with current reality
516
+
517
+ Runs HCO sequence: ingest → infer → suggest
518
+
519
+ Outputs: [Current Task] [Progress %] [Next Action]
520
+ ```
521
+
522
+ ### Results
523
+
524
+ - **80%+ sessions resumed without typing**
525
+ - **10-100x token reduction** (2000 → 200 tokens)
526
+ - **<10 seconds to first productive action**
527
+ - **30-75% developer productivity increase**
528
+
529
+ ## Use Cases
530
+
531
+ | Use Case | How HCR Helps |
532
+ |----------|---------------|
533
+ | **Resume Work** | Know exactly where you left off after a break, weekend, or vacation |
534
+ | **Code Review** | Track intent behind changes, not just diffs. Understand the "why" |
535
+ | **Onboarding** | New team members see the complete context and decision history |
536
+ | **Debugging** | Correlate errors with recent changes and developer intent |
537
+ | **AI Assistants** | Context persists across conversations, devices, and sessions |
538
+ | **Enterprise Governance** | Audit trails, compliance reporting, team-wide state management |
539
+ | **Context Switching** | Seamlessly switch between projects without losing momentum |
540
+
541
+ ## Performance Metrics
542
+
543
+ | Metric | Value |
544
+ |--------|-------|
545
+ | **Session Resume Rate** | >80% without typing |
546
+ | **Token Reduction** | 10-100x vs traditional context rebuilding |
547
+ | **Time to First Action** | <10 seconds |
548
+ | **Test Coverage** | 384 tests passing, 6 skipped (100% pass rate) |
549
+ | **LLM Providers** | Groq, Gemini, Ollama, OpenAI, Anthropic |
550
+ | **MCP Tools** | 32 tools, 3 resources, 2 prompts |
551
+ | **Enterprise Security** | RBAC + Audit + Compliance |
552
+
553
+ ## Development Status
554
+
555
+ ### Completed Phases ✅
556
+ - **Phase 1**: Core Infrastructure (State, Operators, Engine)
557
+ - **Phase 2**: Real LLM Integration (Multi-provider support)
558
+ - **Phase 3**: Autonomous Context Extraction (Daemon, file watcher)
559
+ - **Phase 4**: State Visualizer (Web dashboard with ReactFlow)
560
+ - **Phase 5**: Commercial SaaS UI (Professional web interface)
561
+
562
+ ### Current Focus 🔄
563
+ - VS Code Extension development
564
+ - Enterprise partnerships
565
+ - Advanced predictive features
566
+
567
+ ### Roadmap 📋
568
+ See [docs/tasks.md](docs/tasks.md) for detailed development roadmap.
569
+
570
+ ## Support & Resources
571
+
572
+ ### Documentation
573
+ - [Project Memory](docs/project_memory.md) - Design decisions and context
574
+ - [Architecture](docs/architecture.md) - System architecture details
575
+ - [Tasks](docs/tasks.md) - Development roadmap
576
+ - [Product Spec](product/PRODUCT_SPEC.md) - Feature specifications
577
+
578
+ ### Community
579
+ - **Issues**: [GitHub Issues](https://github.com/PantheraLabs/HybridCognitiveRuntime/issues)
580
+ - **Discussions**: [GitHub Discussions](https://github.com/PantheraLabs/HybridCognitiveRuntime/discussions)
581
+
582
+ ### Enterprise Support
583
+ For enterprise licensing, SLAs, and dedicated support, contact the team.
584
+
585
+ ---
586
+
587
+ ## License
588
+
589
+ This project is licensed under a **Proprietary License**. The source code is visible for reference only.
590
+
591
+ **No license is granted for:**
592
+ - Commercial use without written consent
593
+ - Modification or derivative works
594
+ - Distribution or sublicensing
595
+
596
+ See the [LICENSE](LICENSE) file for full terms. For licensing inquiries, please contact the author.
597
+
598
+ ---
599
+
600
+ ## Links
601
+
602
+ - **Documentation**: [docs/](docs/)
603
+ - **Examples**: [examples/](examples/)
604
+ - **Web Dashboard**: `hcr dashboard`
605
+ - **CLI Reference**: `hcr --help`
606
+
607
+ ---
608
+
609
+ <div align="center">
610
+ <p><strong>Built with ❤️ by PantheraLabs</strong></p>
611
+ <p><em>Intelligence should persist. Context should resume.</em></p>
612
+ <p><small>The Brain Behind Your AI Assistant</small></p>
613
+ </div>
614
+
615
+ ## 📄 License
616
+
617
+ This project is licensed under a **Proprietary License**. The source code is visible for reference only.
618
+
619
+ **No license is granted for:**
620
+ - Commercial use without written consent
621
+ - Modification or derivative works
622
+ - Distribution or sublicensing
623
+
624
+ See the [LICENSE](LICENSE) file for full terms. For licensing inquiries, please contact the author.
625
+
626
+ ## 🔗 Links
627
+
628
+ - **Documentation**: [docs/](docs/)
629
+ - **Examples**: [examples/](examples/)
630
+ - **Issues**: [GitHub Issues](https://github.com/PantheraLabs/HybridCognitiveRuntime/issues)
631
+ - **Discussions**: [GitHub Discussions](https://github.com/PantheraLabs/HybridCognitiveRuntime/discussions)
632
+