pyeye-mcp 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. pyeye_mcp-1.0.1/.claude/README.md +60 -0
  2. pyeye_mcp-1.0.1/.claude/agents/INTEGRATION-EXAMPLE.md +238 -0
  3. pyeye_mcp-1.0.1/.claude/agents/README-SELF-IMPROVEMENT.md +326 -0
  4. pyeye_mcp-1.0.1/.claude/agents/TEMPLATE-WITH-LEARNING.md +296 -0
  5. pyeye_mcp-1.0.1/.claude/agents/cross-platform-issues.yaml +133 -0
  6. pyeye_mcp-1.0.1/.claude/agents/cross-platform-validator.md +195 -0
  7. pyeye_mcp-1.0.1/.claude/agents/pr-workflow.md +391 -0
  8. pyeye_mcp-1.0.1/.claude/agents/smart-commit-examples.md +193 -0
  9. pyeye_mcp-1.0.1/.claude/agents/smart-commit.md +316 -0
  10. pyeye_mcp-1.0.1/.claude/agents/worktree-manager.md +521 -0
  11. pyeye_mcp-1.0.1/.claude/feedback/.counters/worktree-manager.count +1 -0
  12. pyeye_mcp-1.0.1/.claude/feedback/.gitignore +9 -0
  13. pyeye_mcp-1.0.1/.claude/feedback/.last_analysis_worktree-manager +0 -0
  14. pyeye_mcp-1.0.1/.claude/feedback/.outcomes/worktree-manager.recent +2 -0
  15. pyeye_mcp-1.0.1/.claude/feedback/.patterns/worktree-manager.patterns +0 -0
  16. pyeye_mcp-1.0.1/.claude/feedback/.profiles/worktree-manager.profile +6 -0
  17. pyeye_mcp-1.0.1/.claude/feedback/ARCHITECTURE-DECISION.md +192 -0
  18. pyeye_mcp-1.0.1/.claude/feedback/EVENT-DRIVEN-SUMMARY.md +180 -0
  19. pyeye_mcp-1.0.1/.claude/feedback/IMPLEMENTATION-SUMMARY.md +174 -0
  20. pyeye_mcp-1.0.1/.claude/feedback/LEARNING-LIFECYCLE.md +249 -0
  21. pyeye_mcp-1.0.1/.claude/feedback/QUICK-START.md +109 -0
  22. pyeye_mcp-1.0.1/.claude/feedback/README.md +170 -0
  23. pyeye_mcp-1.0.1/.claude/feedback/WHEN-AGENTS-GET-SMARTER.md +196 -0
  24. pyeye_mcp-1.0.1/.claude/feedback/analyze_agent_performance.py +372 -0
  25. pyeye_mcp-1.0.1/.claude/feedback/apply_learnings.sh +247 -0
  26. pyeye_mcp-1.0.1/.claude/feedback/event_driven_learning.sh +536 -0
  27. pyeye_mcp-1.0.1/.claude/feedback/learnings/worktree-manager-learnings.md +174 -0
  28. pyeye_mcp-1.0.1/.claude/feedback/learnings/worktree-manager-report-20250830_152419.md +37 -0
  29. pyeye_mcp-1.0.1/.claude/feedback/learnings/worktree-manager-report-20250830_152513.md +37 -0
  30. pyeye_mcp-1.0.1/.claude/feedback/logs/.gitkeep +0 -0
  31. pyeye_mcp-1.0.1/.claude/feedback/metrics/.gitkeep +0 -0
  32. pyeye_mcp-1.0.1/.claude/instructions/00-documentation-system.md +146 -0
  33. pyeye_mcp-1.0.1/.claude/instructions/01-core-rules.md +140 -0
  34. pyeye_mcp-1.0.1/.claude/instructions/02-session-startup.md +136 -0
  35. pyeye_mcp-1.0.1/.claude/instructions/03-mcp-dogfooding.md +221 -0
  36. pyeye_mcp-1.0.1/.claude/instructions/04-agent-triggers.md +97 -0
  37. pyeye_mcp-1.0.1/.claude/instructions/05-workflow-issues.md +100 -0
  38. pyeye_mcp-1.0.1/.claude/instructions/06-workflow-commits.md +144 -0
  39. pyeye_mcp-1.0.1/.claude/instructions/07-validation.md +185 -0
  40. pyeye_mcp-1.0.1/.claude/instructions/08-project-specific.md +146 -0
  41. pyeye_mcp-1.0.1/.claude/instructions/09-task-management.md +125 -0
  42. pyeye_mcp-1.0.1/.claude/instructions/10-cross-platform.md +115 -0
  43. pyeye_mcp-1.0.1/.claude/instructions/11-pr-requirements.md +101 -0
  44. pyeye_mcp-1.0.1/.claude/settings.json +11 -0
  45. pyeye_mcp-1.0.1/.claude/startup-context.md +154 -0
  46. pyeye_mcp-1.0.1/.claude/worktree-helper.sh +108 -0
  47. pyeye_mcp-1.0.1/.github/dependabot.yml +67 -0
  48. pyeye_mcp-1.0.1/.github/pull_request_template.md +63 -0
  49. pyeye_mcp-1.0.1/.github/workflows/build-deploy-docs.yml +55 -0
  50. pyeye_mcp-1.0.1/.github/workflows/ci.yml +329 -0
  51. pyeye_mcp-1.0.1/.github/workflows/docs.yml +48 -0
  52. pyeye_mcp-1.0.1/.github/workflows/release.yml +287 -0
  53. pyeye_mcp-1.0.1/.gitignore +161 -0
  54. pyeye_mcp-1.0.1/.markdownlint.yaml +5 -0
  55. pyeye_mcp-1.0.1/.mcp.json.example +19 -0
  56. pyeye_mcp-1.0.1/.pre-commit-config.yaml +125 -0
  57. pyeye_mcp-1.0.1/.pydocstyle +5 -0
  58. pyeye_mcp-1.0.1/.pyeye.json.example +29 -0
  59. pyeye_mcp-1.0.1/.secrets.baseline +127 -0
  60. pyeye_mcp-1.0.1/CHANGELOG.md +264 -0
  61. pyeye_mcp-1.0.1/CLAUDE.md +80 -0
  62. pyeye_mcp-1.0.1/CONTRIBUTING.md +238 -0
  63. pyeye_mcp-1.0.1/DOCUMENTATION.md +859 -0
  64. pyeye_mcp-1.0.1/IMPLEMENTATION_SUMMARY.md +118 -0
  65. pyeye_mcp-1.0.1/LICENSE +21 -0
  66. pyeye_mcp-1.0.1/MIGRATION-PYEYE.md +216 -0
  67. pyeye_mcp-1.0.1/PKG-INFO +776 -0
  68. pyeye_mcp-1.0.1/README.md +725 -0
  69. pyeye_mcp-1.0.1/TEST_MIGRATION_GUIDE.md +129 -0
  70. pyeye_mcp-1.0.1/benchmarks/BASELINE_RESULTS.md +61 -0
  71. pyeye_mcp-1.0.1/benchmarks/benchmark_simple.py +84 -0
  72. pyeye_mcp-1.0.1/demo_analysis.md +83 -0
  73. pyeye_mcp-1.0.1/demo_find_symbol.py +124 -0
  74. pyeye_mcp-1.0.1/docs/CLAUDE_AGENTS.md +344 -0
  75. pyeye_mcp-1.0.1/docs/CLAUDE_WORKTREE_WORKFLOW.md +242 -0
  76. pyeye_mcp-1.0.1/docs/COVERAGE.md +201 -0
  77. pyeye_mcp-1.0.1/docs/DOGFOODING_INTEGRATION.md +204 -0
  78. pyeye_mcp-1.0.1/docs/DOGFOODING_SETUP.md +207 -0
  79. pyeye_mcp-1.0.1/docs/LABELS.md +132 -0
  80. pyeye_mcp-1.0.1/docs/METRICS_BASELINE.md +96 -0
  81. pyeye_mcp-1.0.1/docs/Makefile +37 -0
  82. pyeye_mcp-1.0.1/docs/RELEASE.md +154 -0
  83. pyeye_mcp-1.0.1/docs/TROUBLESHOOTING.md +796 -0
  84. pyeye_mcp-1.0.1/docs/UNIFIED_METRICS.md +315 -0
  85. pyeye_mcp-1.0.1/docs/api/README.md +166 -0
  86. pyeye_mcp-1.0.1/docs/api/core-navigation.md +845 -0
  87. pyeye_mcp-1.0.1/docs/api/django-tools.md +1047 -0
  88. pyeye_mcp-1.0.1/docs/api/flask-tools.md +1196 -0
  89. pyeye_mcp-1.0.1/docs/api/module-analysis.md +647 -0
  90. pyeye_mcp-1.0.1/docs/api/pydantic-tools.md +1041 -0
  91. pyeye_mcp-1.0.1/docs/api/quick-reference.md +297 -0
  92. pyeye_mcp-1.0.1/docs/development/test_generation_guidelines.md +195 -0
  93. pyeye_mcp-1.0.1/docs/migration-guide.md +330 -0
  94. pyeye_mcp-1.0.1/docs/namespace-packages.md +446 -0
  95. pyeye_mcp-1.0.1/docs/source/_static/.gitkeep +0 -0
  96. pyeye_mcp-1.0.1/docs/source/api/index.rst +66 -0
  97. pyeye_mcp-1.0.1/docs/source/architecture/caching-strategy.rst +341 -0
  98. pyeye_mcp-1.0.1/docs/source/architecture/index.rst +13 -0
  99. pyeye_mcp-1.0.1/docs/source/architecture/overview.rst +174 -0
  100. pyeye_mcp-1.0.1/docs/source/architecture/plugin-system.rst +307 -0
  101. pyeye_mcp-1.0.1/docs/source/conf.py +115 -0
  102. pyeye_mcp-1.0.1/docs/source/configuration.rst +424 -0
  103. pyeye_mcp-1.0.1/docs/source/contributing.rst +265 -0
  104. pyeye_mcp-1.0.1/docs/source/examples/index.rst +367 -0
  105. pyeye_mcp-1.0.1/docs/source/index.rst +97 -0
  106. pyeye_mcp-1.0.1/docs/source/quickstart.rst +208 -0
  107. pyeye_mcp-1.0.1/docs/test_coverage_agent_usage.md +254 -0
  108. pyeye_mcp-1.0.1/docs/testing/CONVENTIONS.md +522 -0
  109. pyeye_mcp-1.0.1/docs/testing/FIXTURES.md +617 -0
  110. pyeye_mcp-1.0.1/docs/testing/PERFORMANCE.md +619 -0
  111. pyeye_mcp-1.0.1/docs/testing/STRATEGY.md +366 -0
  112. pyeye_mcp-1.0.1/examples/configurations/enterprise.json +97 -0
  113. pyeye_mcp-1.0.1/examples/configurations/microservices.json +47 -0
  114. pyeye_mcp-1.0.1/examples/configurations/monorepo.json +27 -0
  115. pyeye_mcp-1.0.1/examples/configurations/plugin-system.json +46 -0
  116. pyeye_mcp-1.0.1/examples/test_project/example.py +155 -0
  117. pyeye_mcp-1.0.1/pyproject.toml +181 -0
  118. pyeye_mcp-1.0.1/scripts/check_cross_platform_paths.py +187 -0
  119. pyeye_mcp-1.0.1/scripts/claude_hooks/README.md +193 -0
  120. pyeye_mcp-1.0.1/scripts/claude_hooks/detect_grep_usage.py +97 -0
  121. pyeye_mcp-1.0.1/scripts/claude_hooks/hooks.json +64 -0
  122. pyeye_mcp-1.0.1/scripts/claude_hooks/mcp_analytics.py +214 -0
  123. pyeye_mcp-1.0.1/scripts/claude_hooks/session_tracker.py +71 -0
  124. pyeye_mcp-1.0.1/scripts/claude_hooks/setup_mcp_monitoring.sh +156 -0
  125. pyeye_mcp-1.0.1/scripts/claude_hooks/track_mcp_call.py +66 -0
  126. pyeye_mcp-1.0.1/scripts/claude_hooks/track_mcp_success.py +72 -0
  127. pyeye_mcp-1.0.1/scripts/dogfooding_metrics.py +402 -0
  128. pyeye_mcp-1.0.1/scripts/grep_tracker.sh +56 -0
  129. pyeye_mcp-1.0.1/scripts/install_hooks.sh +98 -0
  130. pyeye_mcp-1.0.1/scripts/mcp_wrapper.sh +11 -0
  131. pyeye_mcp-1.0.1/scripts/setup_aliases.sh +78 -0
  132. pyeye_mcp-1.0.1/scripts/setup_dogfooding.sh +107 -0
  133. pyeye_mcp-1.0.1/scripts/setup_grep_tracking.sh +66 -0
  134. pyeye_mcp-1.0.1/scripts/test_coverage_agent.py +237 -0
  135. pyeye_mcp-1.0.1/scripts/test_cross_platform_agent.py +146 -0
  136. pyeye_mcp-1.0.1/scripts/unified_metrics.py +285 -0
  137. pyeye_mcp-1.0.1/scripts/validate_changelog.py +191 -0
  138. pyeye_mcp-1.0.1/scripts/worktree_safety.py +328 -0
  139. pyeye_mcp-1.0.1/setup.cfg +4 -0
  140. pyeye_mcp-1.0.1/setup.sh +45 -0
  141. pyeye_mcp-1.0.1/src/pyeye/__init__.py +22 -0
  142. pyeye_mcp-1.0.1/src/pyeye/_version.py +3 -0
  143. pyeye_mcp-1.0.1/src/pyeye/_version.pyi +2 -0
  144. pyeye_mcp-1.0.1/src/pyeye/agents/__init__.py +8 -0
  145. pyeye_mcp-1.0.1/src/pyeye/agents/test_coverage.py +291 -0
  146. pyeye_mcp-1.0.1/src/pyeye/agents/test_coverage_enhanced.py +599 -0
  147. pyeye_mcp-1.0.1/src/pyeye/analyzers/__init__.py +5 -0
  148. pyeye_mcp-1.0.1/src/pyeye/analyzers/jedi_analyzer.py +2723 -0
  149. pyeye_mcp-1.0.1/src/pyeye/async_utils.py +250 -0
  150. pyeye_mcp-1.0.1/src/pyeye/cache.py +439 -0
  151. pyeye_mcp-1.0.1/src/pyeye/config.py +538 -0
  152. pyeye_mcp-1.0.1/src/pyeye/connection_pool.py +238 -0
  153. pyeye_mcp-1.0.1/src/pyeye/constants.py +25 -0
  154. pyeye_mcp-1.0.1/src/pyeye/dependency_tracker.py +194 -0
  155. pyeye_mcp-1.0.1/src/pyeye/dogfooding_integration.py +188 -0
  156. pyeye_mcp-1.0.1/src/pyeye/exceptions.py +315 -0
  157. pyeye_mcp-1.0.1/src/pyeye/import_analyzer.py +332 -0
  158. pyeye_mcp-1.0.1/src/pyeye/mcp/__init__.py +5 -0
  159. pyeye_mcp-1.0.1/src/pyeye/mcp/__main__.py +10 -0
  160. pyeye_mcp-1.0.1/src/pyeye/mcp/server.py +845 -0
  161. pyeye_mcp-1.0.1/src/pyeye/metrics.py +355 -0
  162. pyeye_mcp-1.0.1/src/pyeye/metrics_hook.py +129 -0
  163. pyeye_mcp-1.0.1/src/pyeye/namespace_resolver.py +261 -0
  164. pyeye_mcp-1.0.1/src/pyeye/path_utils.py +139 -0
  165. pyeye_mcp-1.0.1/src/pyeye/plugins/__init__.py +5 -0
  166. pyeye_mcp-1.0.1/src/pyeye/plugins/base.py +237 -0
  167. pyeye_mcp-1.0.1/src/pyeye/plugins/django.py +251 -0
  168. pyeye_mcp-1.0.1/src/pyeye/plugins/flask.py +612 -0
  169. pyeye_mcp-1.0.1/src/pyeye/plugins/pydantic.py +499 -0
  170. pyeye_mcp-1.0.1/src/pyeye/project_manager.py +377 -0
  171. pyeye_mcp-1.0.1/src/pyeye/scope_utils.py +543 -0
  172. pyeye_mcp-1.0.1/src/pyeye/settings.py +195 -0
  173. pyeye_mcp-1.0.1/src/pyeye/symbol_parser.py +151 -0
  174. pyeye_mcp-1.0.1/src/pyeye/unified_metrics.py +495 -0
  175. pyeye_mcp-1.0.1/src/pyeye/validation.py +401 -0
  176. pyeye_mcp-1.0.1/src/pyeye/workflows/code_review_pr.md +670 -0
  177. pyeye_mcp-1.0.1/src/pyeye/workflows/code_review_security.md +641 -0
  178. pyeye_mcp-1.0.1/src/pyeye/workflows/code_review_standards.md +722 -0
  179. pyeye_mcp-1.0.1/src/pyeye/workflows/code_understanding.md +357 -0
  180. pyeye_mcp-1.0.1/src/pyeye/workflows/dependency_analysis.md +460 -0
  181. pyeye_mcp-1.0.1/src/pyeye/workflows/find_references.md +161 -0
  182. pyeye_mcp-1.0.1/src/pyeye/workflows/refactoring.md +254 -0
  183. pyeye_mcp-1.0.1/src/pyeye_mcp.egg-info/PKG-INFO +776 -0
  184. pyeye_mcp-1.0.1/src/pyeye_mcp.egg-info/SOURCES.txt +256 -0
  185. pyeye_mcp-1.0.1/src/pyeye_mcp.egg-info/dependency_links.txt +1 -0
  186. pyeye_mcp-1.0.1/src/pyeye_mcp.egg-info/requires.txt +29 -0
  187. pyeye_mcp-1.0.1/src/pyeye_mcp.egg-info/top_level.txt +1 -0
  188. pyeye_mcp-1.0.1/tests/__init__.py +1 -0
  189. pyeye_mcp-1.0.1/tests/conftest.py +319 -0
  190. pyeye_mcp-1.0.1/tests/e2e/__init__.py +0 -0
  191. pyeye_mcp-1.0.1/tests/e2e/scenarios/test_end_to_end.py +396 -0
  192. pyeye_mcp-1.0.1/tests/fixtures/__init__.py +0 -0
  193. pyeye_mcp-1.0.1/tests/fixtures/factories.py +449 -0
  194. pyeye_mcp-1.0.1/tests/fixtures/reexport_test/__init__.py +1 -0
  195. pyeye_mcp-1.0.1/tests/fixtures/reexport_test/core/__init__.py +9 -0
  196. pyeye_mcp-1.0.1/tests/fixtures/reexport_test/core/auth/__init__.py +5 -0
  197. pyeye_mcp-1.0.1/tests/fixtures/reexport_test/core/auth/authenticator.py +18 -0
  198. pyeye_mcp-1.0.1/tests/fixtures/reexport_test/models/__init__.py +10 -0
  199. pyeye_mcp-1.0.1/tests/fixtures/reexport_test/models/user.py +26 -0
  200. pyeye_mcp-1.0.1/tests/fixtures/standalone_project/.pyeye.json +14 -0
  201. pyeye_mcp-1.0.1/tests/fixtures/standalone_project/mypackage/__init__.py +5 -0
  202. pyeye_mcp-1.0.1/tests/fixtures/standalone_project/mypackage/models.py +18 -0
  203. pyeye_mcp-1.0.1/tests/fixtures/standalone_project/notebooks/analysis1.py +19 -0
  204. pyeye_mcp-1.0.1/tests/fixtures/standalone_project/notebooks/analysis2.py +17 -0
  205. pyeye_mcp-1.0.1/tests/fixtures/standalone_project/scripts/migrate.py +24 -0
  206. pyeye_mcp-1.0.1/tests/integration/__init__.py +0 -0
  207. pyeye_mcp-1.0.1/tests/integration/cache_system/test_smart_invalidation_integration.py +360 -0
  208. pyeye_mcp-1.0.1/tests/integration/jedi_integration/test_jedi_analyzer.py +1051 -0
  209. pyeye_mcp-1.0.1/tests/integration/jedi_integration/test_jedi_integration.py +355 -0
  210. pyeye_mcp-1.0.1/tests/integration/jedi_integration/test_module_analysis.py +469 -0
  211. pyeye_mcp-1.0.1/tests/integration/jedi_integration/test_relative_imports.py +377 -0
  212. pyeye_mcp-1.0.1/tests/integration/jedi_integration/test_src_layout.py +610 -0
  213. pyeye_mcp-1.0.1/tests/integration/mcp_protocol/test_mcp_integration.py +184 -0
  214. pyeye_mcp-1.0.1/tests/integration/mcp_protocol/test_server.py +847 -0
  215. pyeye_mcp-1.0.1/tests/integration/test_compound_symbols.py +358 -0
  216. pyeye_mcp-1.0.1/tests/integration/test_connection_pool.py +366 -0
  217. pyeye_mcp-1.0.1/tests/integration/test_dependency_tracker.py +300 -0
  218. pyeye_mcp-1.0.1/tests/integration/test_namespace_methods.py +632 -0
  219. pyeye_mcp-1.0.1/tests/integration/test_namespace_resolver.py +282 -0
  220. pyeye_mcp-1.0.1/tests/integration/test_namespace_support.py +469 -0
  221. pyeye_mcp-1.0.1/tests/integration/test_polymorphic_references.py +475 -0
  222. pyeye_mcp-1.0.1/tests/integration/test_project_manager.py +247 -0
  223. pyeye_mcp-1.0.1/tests/integration/test_project_manager_pooling.py +295 -0
  224. pyeye_mcp-1.0.1/tests/integration/test_scope_configuration.py +403 -0
  225. pyeye_mcp-1.0.1/tests/integration/test_standalone_scripts.py +271 -0
  226. pyeye_mcp-1.0.1/tests/performance/__init__.py +0 -0
  227. pyeye_mcp-1.0.1/tests/performance/benchmarks/test_find_imports_performance.py +185 -0
  228. pyeye_mcp-1.0.1/tests/performance/benchmarks/test_performance_benchmarks.py +439 -0
  229. pyeye_mcp-1.0.1/tests/performance/benchmarks/test_performance_regression.py +369 -0
  230. pyeye_mcp-1.0.1/tests/performance/benchmarks/test_scope_performance.py +430 -0
  231. pyeye_mcp-1.0.1/tests/test_automation.py +207 -0
  232. pyeye_mcp-1.0.1/tests/test_coverage_agent.py +422 -0
  233. pyeye_mcp-1.0.1/tests/test_dogfooding_integration.py +205 -0
  234. pyeye_mcp-1.0.1/tests/test_dogfooding_metrics.py +149 -0
  235. pyeye_mcp-1.0.1/tests/test_dogfooding_workflow.py +84 -0
  236. pyeye_mcp-1.0.1/tests/test_get_type_info_inheritance.py +575 -0
  237. pyeye_mcp-1.0.1/tests/test_helpers.py +15 -0
  238. pyeye_mcp-1.0.1/tests/test_posixpath_serialization.py +155 -0
  239. pyeye_mcp-1.0.1/tests/test_resources.py +258 -0
  240. pyeye_mcp-1.0.1/tests/unit/__init__.py +0 -0
  241. pyeye_mcp-1.0.1/tests/unit/core/test_cache.py +300 -0
  242. pyeye_mcp-1.0.1/tests/unit/core/test_config.py +524 -0
  243. pyeye_mcp-1.0.1/tests/unit/core/test_exceptions.py +246 -0
  244. pyeye_mcp-1.0.1/tests/unit/core/test_granular_cache.py +436 -0
  245. pyeye_mcp-1.0.1/tests/unit/core/test_settings.py +212 -0
  246. pyeye_mcp-1.0.1/tests/unit/core/test_validation.py +323 -0
  247. pyeye_mcp-1.0.1/tests/unit/core/test_version_validation.py +35 -0
  248. pyeye_mcp-1.0.1/tests/unit/plugins/test_django_plugin.py +387 -0
  249. pyeye_mcp-1.0.1/tests/unit/plugins/test_flask_plugin.py +750 -0
  250. pyeye_mcp-1.0.1/tests/unit/plugins/test_pydantic_plugin.py +758 -0
  251. pyeye_mcp-1.0.1/tests/unit/test_symbol_parser.py +249 -0
  252. pyeye_mcp-1.0.1/tests/unit/utils/test_async_utils.py +656 -0
  253. pyeye_mcp-1.0.1/tests/unit/utils/test_metrics.py +338 -0
  254. pyeye_mcp-1.0.1/tests/unit/utils/test_path_utils.py +341 -0
  255. pyeye_mcp-1.0.1/tests/unit/utils/test_unified_metrics_core.py +167 -0
  256. pyeye_mcp-1.0.1/tests/unit/utils/test_utils.py +137 -0
  257. pyeye_mcp-1.0.1/tests/utils/__init__.py +1 -0
  258. pyeye_mcp-1.0.1/tests/utils/performance.py +166 -0
@@ -0,0 +1,60 @@
1
+ # ⚠️ This Directory is for Claude Code, Not Humans
2
+
3
+ ## Humans: You're in the Wrong Place
4
+
5
+ This directory contains behavioral instructions for Claude Code (AI assistant). These files control how Claude behaves when working on this project.
6
+
7
+ ### Looking for Documentation?
8
+
9
+ - **Project Overview**: See [`/README.md`](../README.md)
10
+ - **Contributing Guide**: See [`/CONTRIBUTING.md`](../CONTRIBUTING.md)
11
+ - **Documentation**: See [`/docs`](../docs/)
12
+ - **API Reference**: See [`/docs/api`](../docs/api/)
13
+
14
+ ### For Maintainers Only
15
+
16
+ If you need to modify Claude's behavior:
17
+
18
+ #### Directory Structure
19
+
20
+ ```text
21
+ .claude/
22
+ ├── instructions/ # Modular behavior rules
23
+ │ ├── 00-*.md # Core understanding
24
+ │ ├── 01-*.md # Fundamental rules
25
+ │ ├── 02-*.md # Startup/context
26
+ │ └── ... # Other behaviors
27
+ ├── agents/ # Agent definitions
28
+ ├── feedback/ # Learning/logs
29
+ └── settings.json # Configuration
30
+ ```
31
+
32
+ #### Key Files
33
+
34
+ - `instructions/00-documentation-system.md` - Teaches Claude about documentation
35
+ - `instructions/01-core-rules.md` - Critical behavior rules
36
+ - `instructions/04-agent-triggers.md` - When to use specific agents
37
+
38
+ #### Making Changes
39
+
40
+ 1. Changes here immediately affect Claude's behavior
41
+ 2. Use IMPERATIVE language (MUST, NEVER, ALWAYS)
42
+ 3. Keep instructions concise and enforceable
43
+ 4. Don't put human explanations here - use `/docs` instead
44
+
45
+ #### Understanding the System
46
+
47
+ The instruction files use a numbered prefix system:
48
+
49
+ - `00-*` Foundational understanding
50
+ - `01-*` Core rules and enforcement
51
+ - `02-*` Startup and context detection
52
+ - `03-*` Required practices
53
+ - `04-*` Behavioral triggers
54
+ - `05-07-*` Workflows
55
+ - `08-*` Project-specific
56
+ - `09-10-*` Tools and utilities
57
+
58
+ ### Warning
59
+
60
+ Modifying these files changes how Claude behaves across ALL sessions on this project. Be careful and test changes thoroughly.
@@ -0,0 +1,238 @@
1
+ ---
2
+ name: example-with-event-learning
3
+ description: Example agent showing how to integrate with event-driven learning
4
+ tools: Bash, Read, Edit
5
+ color: cyan
6
+ ---
7
+
8
+ # Example Agent with Event-Driven Learning Integration
9
+
10
+ This example shows how agents can integrate with the event-driven learning system.
11
+
12
+ ## Startup: Source the Learning System
13
+
14
+ ```bash
15
+ # At agent startup, source the learning functions
16
+ source "${CLAUDE_FEEDBACK_DIR:-/home/mark/GitHub/pyeye-mcp-work/claude-development/.claude/feedback}/event_driven_learning.sh"
17
+
18
+ AGENT_NAME="example-with-event-learning"
19
+
20
+ # Signal execution start (increments counter, checks thresholds)
21
+ handle_agent_event "execution_start" "$AGENT_NAME"
22
+ ```
23
+
24
+ ## During Execution: Track Events
25
+
26
+ ```bash
27
+ # Example task function with event tracking
28
+ perform_task() {
29
+ local task_path="$1"
30
+
31
+ # Try the operation
32
+ if cd "$task_path" 2>/dev/null; then
33
+ echo "✓ Successfully changed to $task_path"
34
+ else
35
+ # Log the issue pattern
36
+ handle_agent_event "issue_detected" "$AGENT_NAME" "path_error" "Failed to cd to $task_path"
37
+
38
+ # Try recovery with absolute path
39
+ task_path="$(realpath "$task_path" 2>/dev/null || pwd)"
40
+ if cd "$task_path"; then
41
+ echo "✓ Recovered using absolute path"
42
+ else
43
+ # Track failure
44
+ handle_agent_event "execution_complete" "$AGENT_NAME" "failure"
45
+ return 1
46
+ fi
47
+ fi
48
+
49
+ # Continue with task...
50
+ echo "Performing task in $(pwd)"
51
+
52
+ # Simulate some work
53
+ if [ -w "." ]; then
54
+ echo "✓ Have write permissions"
55
+ else
56
+ # Another pattern to track
57
+ handle_agent_event "issue_detected" "$AGENT_NAME" "permission_denied" "No write permission in $(pwd)"
58
+ fi
59
+
60
+ return 0
61
+ }
62
+ ```
63
+
64
+ ## Completion: Report Outcome
65
+
66
+ ```bash
67
+ # Main execution flow
68
+ main() {
69
+ echo "Starting $AGENT_NAME"
70
+
71
+ # Track start
72
+ handle_agent_event "execution_start" "$AGENT_NAME"
73
+
74
+ # Perform the actual work
75
+ if perform_task "$@"; then
76
+ # Success
77
+ handle_agent_event "execution_complete" "$AGENT_NAME" "success"
78
+ echo "✅ Task completed successfully"
79
+ else
80
+ # Failure
81
+ handle_agent_event "execution_complete" "$AGENT_NAME" "failure"
82
+ echo "❌ Task failed"
83
+ fi
84
+
85
+ # The event system will automatically:
86
+ # 1. Check if execution threshold reached (triggers learning)
87
+ # 2. Monitor failure rate (triggers immediate fixes)
88
+ # 3. Detect repeated patterns (applies known fixes)
89
+ }
90
+ ```
91
+
92
+ ## Real-Time Pattern Response
93
+
94
+ ```bash
95
+ # Advanced: Agent can check for patterns in real-time
96
+ check_and_adapt() {
97
+ local operation=$1
98
+
99
+ # Before attempting operation, check if it's been problematic
100
+ if grep -q "$operation.*failed" "$CLAUDE_FEEDBACK_DIR/.patterns/${AGENT_NAME}.patterns" 2>/dev/null; then
101
+ echo "⚠️ This operation has failed before - using enhanced approach"
102
+
103
+ # Use learned approach
104
+ case "$operation" in
105
+ "cd")
106
+ echo "Using absolute paths (learned from failures)"
107
+ USE_ABSOLUTE_PATHS=true
108
+ ;;
109
+ "git")
110
+ echo "Adding retry logic (learned from failures)"
111
+ MAX_RETRIES=5
112
+ ;;
113
+ esac
114
+ fi
115
+ }
116
+ ```
117
+
118
+ ## Session End Hook
119
+
120
+ ```bash
121
+ # At session end (or context switch)
122
+ cleanup() {
123
+ echo "Session ending for $AGENT_NAME"
124
+
125
+ # Trigger session-end analysis
126
+ handle_agent_event "session_end"
127
+
128
+ # This will:
129
+ # - Analyze all agents active this session
130
+ # - Apply learnings if thresholds met
131
+ # - Update agent files if patterns detected
132
+ }
133
+
134
+ # Register cleanup
135
+ trap cleanup EXIT
136
+ ```
137
+
138
+ ## How It Works - The Flow
139
+
140
+ 1. **Execution starts** → Counter increments → Checks if threshold reached
141
+ 2. **Issues occur** → Patterns logged → Checks if pattern repeated
142
+ 3. **Execution ends** → Outcome tracked → Checks failure rate
143
+ 4. **Thresholds triggered** → Analysis runs → Fixes applied automatically
144
+
145
+ ## Benefits of Integration
146
+
147
+ 1. **No Manual Tracking** - Events logged automatically
148
+ 2. **Real-Time Response** - Fixes applied during execution
149
+ 3. **Adaptive Thresholds** - Adjusts based on agent performance
150
+ 4. **Known Fix Database** - Common issues fixed immediately
151
+ 5. **Session Persistence** - Learning continues across sessions
152
+
153
+ ## Example Trigger Scenarios
154
+
155
+ ### Scenario 1: Execution Threshold
156
+
157
+ ```text
158
+ Agent runs 10 times → Threshold reached → Analysis triggered →
159
+ Patterns found → Agent updated → Next run uses improvements
160
+ ```
161
+
162
+ ### Scenario 2: High Failure Rate
163
+
164
+ ```text
165
+ 3 failures in last 10 runs → Failure threshold hit →
166
+ Immediate analysis → Critical fixes applied → Agent recovers
167
+ ```
168
+
169
+ ### Scenario 3: Pattern Detection
170
+
171
+ ```text
172
+ Same error 3 times → Pattern detected → Known fix exists →
173
+ Fix applied immediately → Error stops occurring
174
+ ```
175
+
176
+ ## Testing the Integration
177
+
178
+ ```bash
179
+ # Test execution counter
180
+ for i in {1..10}; do
181
+ ./example-with-event-learning.sh test_task
182
+ done
183
+ # Should trigger learning after 10 executions
184
+
185
+ # Test failure tracking
186
+ for i in {1..3}; do
187
+ ./example-with-event-learning.sh /nonexistent/path
188
+ done
189
+ # Should trigger high failure rate response
190
+
191
+ # Test pattern detection
192
+ for i in {1..3}; do
193
+ handle_agent_event "issue_detected" "example-with-event-learning" "timeout"
194
+ done
195
+ # Should detect pattern and suggest/apply timeout fix
196
+ ```
197
+
198
+ ## Customizing Thresholds
199
+
200
+ Create agent-specific profile:
201
+
202
+ ```bash
203
+ cat > $CLAUDE_FEEDBACK_DIR/.profiles/example-with-event-learning.profile << EOF
204
+ EXECUTION_THRESHOLD=5 # Check every 5 runs (not 10)
205
+ FAILURE_THRESHOLD=2 # React after 2 failures (not 3)
206
+ PATTERN_THRESHOLD=2 # Detect pattern after 2 occurrences
207
+ AUTO_FIX_ENABLED=true # Apply fixes automatically
208
+ EOF
209
+ ```
210
+
211
+ ## Monitoring & Metrics
212
+
213
+ Check agent's learning status:
214
+
215
+ ```bash
216
+ # View current counters
217
+ cat $CLAUDE_FEEDBACK_DIR/.counters/example-with-event-learning.count
218
+
219
+ # View recent outcomes
220
+ cat $CLAUDE_FEEDBACK_DIR/.outcomes/example-with-event-learning.recent
221
+
222
+ # View detected patterns
223
+ cat $CLAUDE_FEEDBACK_DIR/.patterns/example-with-event-learning.patterns
224
+
225
+ # Run manual analysis
226
+ $CLAUDE_FEEDBACK_DIR/event_driven_learning.sh check_agent example-with-event-learning
227
+ ```
228
+
229
+ ## The Result
230
+
231
+ Agents that integrate with event-driven learning:
232
+
233
+ - **Get smarter automatically** based on usage
234
+ - **Fix themselves** when patterns detected
235
+ - **Adapt thresholds** based on performance
236
+ - **Share knowledge** through the learning system
237
+
238
+ No cron jobs. No waiting. Just intelligent, event-driven improvement!
@@ -0,0 +1,326 @@
1
+ # Agent Self-Improvement & Learning System
2
+
3
+ ## Overview
4
+
5
+ This document describes the self-improvement feedback mechanism for Claude Code agents, enabling them to learn from issues, adapt their behavior, and improve over time.
6
+
7
+ ## 🎯 Core Principles
8
+
9
+ 1. **Capture Issues**: Document problems as they occur
10
+ 2. **Analyze Patterns**: Identify recurring issues
11
+ 3. **Update Instructions**: Evolve agent behavior based on learnings
12
+ 4. **Track Improvements**: Measure success of changes
13
+ 5. **Share Knowledge**: Cross-agent learning
14
+
15
+ ## 📁 Feedback Structure
16
+
17
+ ### Directory Layout
18
+
19
+ ```text
20
+ .claude/
21
+ ├── agents/
22
+ │ ├── worktree-manager.md
23
+ │ ├── smart-commit.md
24
+ │ ├── pr-workflow.md
25
+ │ └── ...
26
+ ├── feedback/
27
+ │ ├── logs/
28
+ │ │ ├── 2025-01-30-worktree-manager.json
29
+ │ │ ├── 2025-01-30-smart-commit.json
30
+ │ │ └── ...
31
+ │ ├── learnings/
32
+ │ │ ├── worktree-manager-learnings.md
33
+ │ │ ├── smart-commit-learnings.md
34
+ │ │ └── ...
35
+ │ └── metrics/
36
+ │ └── agent-performance.json
37
+ ```
38
+
39
+ ## 📝 Feedback Log Format
40
+
41
+ Each agent execution should log feedback in JSON format:
42
+
43
+ ```json
44
+ {
45
+ "timestamp": "2025-01-30T14:43:40.896644",
46
+ "agent": "worktree-manager",
47
+ "session_id": "claude-session-xyz",
48
+ "task": "Create worktree for issue 115",
49
+ "outcome": "partial_success",
50
+ "issues": [
51
+ {
52
+ "type": "path_error",
53
+ "description": "Failed to cd to relative path from wrong directory",
54
+ "context": "Shell reset to startup directory after git worktree add",
55
+ "impact": "high"
56
+ }
57
+ ],
58
+ "successes": [
59
+ {
60
+ "type": "worktree_created",
61
+ "description": "Successfully created worktree with correct branch naming"
62
+ }
63
+ ],
64
+ "suggestions": [
65
+ "Always use absolute paths for directory changes",
66
+ "Store and restore CLAUDE_WORKING_DIR after shell resets"
67
+ ],
68
+ "execution_time_ms": 3500,
69
+ "tools_used": ["Bash", "TodoWrite"],
70
+ "error_recovery": true
71
+ }
72
+ ```
73
+
74
+ ## 🔄 Learning Loop Process
75
+
76
+ ### 1. Immediate Feedback (During Execution)
77
+
78
+ When an agent encounters an issue:
79
+
80
+ ```bash
81
+ # Agent should log the issue immediately
82
+ echo '{
83
+ "timestamp": "'$(date -Iseconds)'",
84
+ "agent": "worktree-manager",
85
+ "issue": "cd failed due to shell reset",
86
+ "recovery": "using absolute path instead"
87
+ }' >> ~/.claude/feedback/logs/$(date +%Y-%m-%d)-worktree-manager.json
88
+ ```
89
+
90
+ ### 2. Post-Execution Analysis
91
+
92
+ After each agent run, analyze what happened:
93
+
94
+ ```python
95
+ # Pseudocode for analysis
96
+ def analyze_agent_execution(agent_name, session_id):
97
+ # Collect all logs from session
98
+ logs = load_logs(agent_name, session_id)
99
+
100
+ # Identify patterns
101
+ patterns = {
102
+ "repeated_errors": find_repeated_errors(logs),
103
+ "recovery_strategies": extract_successful_recoveries(logs),
104
+ "performance_issues": identify_slow_operations(logs)
105
+ }
106
+
107
+ # Generate learnings
108
+ learnings = generate_learnings(patterns)
109
+
110
+ # Update agent instructions if needed
111
+ if should_update_agent(learnings):
112
+ update_agent_instructions(agent_name, learnings)
113
+ ```
114
+
115
+ ### 3. Learning Extraction
116
+
117
+ Convert feedback into actionable learnings:
118
+
119
+ ```markdown
120
+ ## Learnings for worktree-manager
121
+
122
+ ### Issue: Shell Directory Reset (Encountered 5 times)
123
+
124
+ **Problem**: After `git worktree add`, the shell resets to CLAUDE_STARTUP_DIR
125
+
126
+ **Root Cause**: Each Bash command runs in isolation, directory context not preserved
127
+
128
+ **Solution**:
129
+ 1. Always use absolute paths
130
+ 2. Export and restore CLAUDE_WORKING_DIR
131
+ 3. Chain commands with && when context matters
132
+
133
+ **Updated Instruction**:
134
+ ```bash
135
+ # OLD (problematic)
136
+ git worktree add ../work/feat-123 -b feat/123
137
+ cd ../work/feat-123
138
+
139
+ # NEW (reliable)
140
+ WORK_DIR="/absolute/path/to/work/feat-123"
141
+ git worktree add "$WORK_DIR" -b feat/123
142
+ cd "$WORK_DIR" && export CLAUDE_WORKING_DIR=$(pwd)
143
+ ```
144
+
145
+ ### Issue: Permission Errors on Windows (Encountered 3 times)
146
+
147
+ **Problem**: chmod operations fail silently on Windows
148
+
149
+ **Solution**: Add platform detection and conditional chmod
150
+
151
+ **Updated Instruction**: Check OS before chmod operations
152
+
153
+ ```text
154
+ ```
155
+
156
+ ## 🚀 Implementation Strategy
157
+
158
+ ### Phase 1: Manual Feedback Collection
159
+
160
+ 1. Create feedback directory structure
161
+ 2. Manually log issues during agent execution
162
+ 3. Weekly review of feedback logs
163
+ 4. Manual updates to agent instructions
164
+
165
+ ### Phase 2: Semi-Automated Collection
166
+
167
+ 1. Add feedback hooks to agent templates
168
+ 2. Automatic JSON logging of issues
169
+ 3. Simple analysis scripts to find patterns
170
+ 4. Suggested updates for human review
171
+
172
+ ### Phase 3: Full Learning Loop
173
+
174
+ 1. Real-time feedback collection
175
+ 2. Automatic pattern detection
176
+ 3. A/B testing of instruction changes
177
+ 4. Continuous improvement metrics
178
+
179
+ ## 📊 Success Metrics
180
+
181
+ Track these metrics to measure improvement:
182
+
183
+ ```json
184
+ {
185
+ "agent": "worktree-manager",
186
+ "period": "2025-01",
187
+ "metrics": {
188
+ "success_rate": 0.85,
189
+ "error_recovery_rate": 0.92,
190
+ "avg_execution_time_ms": 2500,
191
+ "unique_errors": 3,
192
+ "repeated_errors": 1,
193
+ "instruction_updates": 2,
194
+ "user_interventions_required": 0.15
195
+ },
196
+ "improvements": {
197
+ "success_rate_change": "+0.10",
198
+ "execution_time_change": "-500ms",
199
+ "error_reduction": "-40%"
200
+ }
201
+ }
202
+ ```
203
+
204
+ ## 🔧 Quick Fixes Based on Current Issues
205
+
206
+ ### For worktree-manager
207
+
208
+ 1. **Always use absolute paths**
209
+
210
+ ```bash
211
+ MAIN_REPO="/home/mark/GitHub/pyeye-mcp"
212
+ WORK_DIR="$MAIN_REPO-work/feat-123"
213
+ ```
214
+
215
+ 2. **Preserve context across commands**
216
+
217
+ ```bash
218
+ export CLAUDE_WORKING_DIR=$(pwd)
219
+ # After any directory change:
220
+ cd "$SOME_DIR" && export CLAUDE_WORKING_DIR=$(pwd)
221
+ ```
222
+
223
+ 3. **Check before assuming**
224
+
225
+ ```bash
226
+ # Don't assume worktree creation succeeded
227
+ if git worktree add "$WORK_DIR" -b "$BRANCH"; then
228
+ cd "$WORK_DIR"
229
+ else
230
+ echo "Failed to create worktree"
231
+ exit 1
232
+ fi
233
+ ```
234
+
235
+ ### For all agents
236
+
237
+ 1. **Error handling first**
238
+ - Check command success before proceeding
239
+ - Log failures with context
240
+ - Provide recovery strategies
241
+
242
+ 2. **Platform awareness**
243
+ - Test for OS-specific behaviors
244
+ - Use cross-platform alternatives
245
+ - Document platform limitations
246
+
247
+ 3. **State validation**
248
+ - Verify assumptions before operations
249
+ - Check current directory, branch, etc.
250
+ - Report state clearly to user
251
+
252
+ ## 📚 Knowledge Sharing
253
+
254
+ ### Cross-Agent Learnings
255
+
256
+ Some learnings apply to multiple agents:
257
+
258
+ ```markdown
259
+ ## Universal Agent Learnings
260
+
261
+ ### Shell Context Management
262
+ - Applies to: ALL agents using Bash
263
+ - Learning: Shell resets between commands
264
+ - Solution: Export critical variables, use absolute paths
265
+
266
+ ### Git Operations
267
+ - Applies to: worktree-manager, smart-commit, pr-workflow
268
+ - Learning: Git commands can fail silently
269
+ - Solution: Always check exit codes, parse output
270
+
271
+ ### File System Operations
272
+ - Applies to: ALL agents
273
+ - Learning: Relative paths are unreliable
274
+ - Solution: Resolve to absolute paths early
275
+ ```
276
+
277
+ ## 🎯 Next Steps
278
+
279
+ 1. **Immediate**: Update worktree-manager with absolute path usage
280
+ 2. **This Week**: Create feedback logging function for all agents
281
+ 3. **This Month**: Build analysis tool to find patterns
282
+ 4. **This Quarter**: Implement automatic instruction updates
283
+
284
+ ## 📝 Template for Agent Updates
285
+
286
+ When updating an agent based on learnings:
287
+
288
+ ```markdown
289
+ ## Update: [Agent Name] - [Date]
290
+
291
+ ### Issue Addressed
292
+ [Description of the problem]
293
+
294
+ ### Root Cause
295
+ [Why it happened]
296
+
297
+ ### Solution Implemented
298
+ [What was changed]
299
+
300
+ ### Test Case
301
+ [How to verify the fix works]
302
+
303
+ ### Rollback Plan
304
+ [How to revert if issues arise]
305
+ ```
306
+
307
+ ## 🔍 Monitoring & Alerts
308
+
309
+ Set up monitoring for critical agent failures:
310
+
311
+ 1. **Failure threshold**: Alert if success rate < 70%
312
+ 2. **Repeated errors**: Alert if same error occurs 3+ times
313
+ 3. **Performance degradation**: Alert if execution time increases 50%
314
+ 4. **User intervention**: Alert if manual fixes required > 25%
315
+
316
+ ## 🤝 Contributing to Agent Improvement
317
+
318
+ When you encounter an agent issue:
319
+
320
+ 1. **Document it** in the feedback log
321
+ 2. **Attempt recovery** and note what worked
322
+ 3. **Suggest improvement** in the feedback
323
+ 4. **Update instructions** if you have a fix
324
+ 5. **Share learning** in the learnings file
325
+
326
+ Remember: Every issue is an opportunity for the system to improve!