codeprobe 0.1.0a1__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 (115) hide show
  1. codeprobe-0.1.0a1/LICENSE +190 -0
  2. codeprobe-0.1.0a1/PKG-INFO +103 -0
  3. codeprobe-0.1.0a1/README.md +60 -0
  4. codeprobe-0.1.0a1/pyproject.toml +86 -0
  5. codeprobe-0.1.0a1/setup.cfg +4 -0
  6. codeprobe-0.1.0a1/src/codeprobe/__init__.py +3 -0
  7. codeprobe-0.1.0a1/src/codeprobe/__main__.py +5 -0
  8. codeprobe-0.1.0a1/src/codeprobe/adapters/__init__.py +19 -0
  9. codeprobe-0.1.0a1/src/codeprobe/adapters/_base.py +190 -0
  10. codeprobe-0.1.0a1/src/codeprobe/adapters/aider.py +79 -0
  11. codeprobe-0.1.0a1/src/codeprobe/adapters/claude.py +94 -0
  12. codeprobe-0.1.0a1/src/codeprobe/adapters/codex.py +135 -0
  13. codeprobe-0.1.0a1/src/codeprobe/adapters/copilot.py +104 -0
  14. codeprobe-0.1.0a1/src/codeprobe/adapters/openai_compat.py +140 -0
  15. codeprobe-0.1.0a1/src/codeprobe/adapters/protocol.py +113 -0
  16. codeprobe-0.1.0a1/src/codeprobe/adapters/session.py +304 -0
  17. codeprobe-0.1.0a1/src/codeprobe/adapters/telemetry.py +352 -0
  18. codeprobe-0.1.0a1/src/codeprobe/analysis/__init__.py +46 -0
  19. codeprobe-0.1.0a1/src/codeprobe/analysis/ranking.py +106 -0
  20. codeprobe-0.1.0a1/src/codeprobe/analysis/report.py +558 -0
  21. codeprobe-0.1.0a1/src/codeprobe/analysis/stats.py +455 -0
  22. codeprobe-0.1.0a1/src/codeprobe/api.py +182 -0
  23. codeprobe-0.1.0a1/src/codeprobe/assess/__init__.py +27 -0
  24. codeprobe-0.1.0a1/src/codeprobe/assess/heuristics.py +544 -0
  25. codeprobe-0.1.0a1/src/codeprobe/cli/__init__.py +258 -0
  26. codeprobe-0.1.0a1/src/codeprobe/cli/assess_cmd.py +41 -0
  27. codeprobe-0.1.0a1/src/codeprobe/cli/experiment_cmd.py +417 -0
  28. codeprobe-0.1.0a1/src/codeprobe/cli/init_cmd.py +167 -0
  29. codeprobe-0.1.0a1/src/codeprobe/cli/interpret_cmd.py +75 -0
  30. codeprobe-0.1.0a1/src/codeprobe/cli/mine_cmd.py +145 -0
  31. codeprobe-0.1.0a1/src/codeprobe/cli/probe_cmd.py +116 -0
  32. codeprobe-0.1.0a1/src/codeprobe/cli/ratings_cmd.py +149 -0
  33. codeprobe-0.1.0a1/src/codeprobe/cli/run_cmd.py +159 -0
  34. codeprobe-0.1.0a1/src/codeprobe/cli/scaffold_cmd.py +97 -0
  35. codeprobe-0.1.0a1/src/codeprobe/cli/wizard.py +122 -0
  36. codeprobe-0.1.0a1/src/codeprobe/cli/yaml_writer.py +59 -0
  37. codeprobe-0.1.0a1/src/codeprobe/config/__init__.py +5 -0
  38. codeprobe-0.1.0a1/src/codeprobe/config/loader.py +234 -0
  39. codeprobe-0.1.0a1/src/codeprobe/contrib/__init__.py +17 -0
  40. codeprobe-0.1.0a1/src/codeprobe/contrib/_shared.py +25 -0
  41. codeprobe-0.1.0a1/src/codeprobe/contrib/adaptive.py +37 -0
  42. codeprobe-0.1.0a1/src/codeprobe/contrib/counterfactual.py +54 -0
  43. codeprobe-0.1.0a1/src/codeprobe/contrib/debate.py +73 -0
  44. codeprobe-0.1.0a1/src/codeprobe/contrib/decision_tree.py +51 -0
  45. codeprobe-0.1.0a1/src/codeprobe/contrib/elo.py +53 -0
  46. codeprobe-0.1.0a1/src/codeprobe/contrib/fingerprint.py +39 -0
  47. codeprobe-0.1.0a1/src/codeprobe/contrib/mutation.py +66 -0
  48. codeprobe-0.1.0a1/src/codeprobe/contrib/pareto.py +64 -0
  49. codeprobe-0.1.0a1/src/codeprobe/contrib/sprt.py +61 -0
  50. codeprobe-0.1.0a1/src/codeprobe/contrib/tournament.py +54 -0
  51. codeprobe-0.1.0a1/src/codeprobe/core/__init__.py +26 -0
  52. codeprobe-0.1.0a1/src/codeprobe/core/checkpoint.py +267 -0
  53. codeprobe-0.1.0a1/src/codeprobe/core/executor.py +606 -0
  54. codeprobe-0.1.0a1/src/codeprobe/core/experiment.py +289 -0
  55. codeprobe-0.1.0a1/src/codeprobe/core/isolation.py +128 -0
  56. codeprobe-0.1.0a1/src/codeprobe/core/llm.py +149 -0
  57. codeprobe-0.1.0a1/src/codeprobe/core/preamble.py +130 -0
  58. codeprobe-0.1.0a1/src/codeprobe/core/registry.py +82 -0
  59. codeprobe-0.1.0a1/src/codeprobe/core/sandbox.py +35 -0
  60. codeprobe-0.1.0a1/src/codeprobe/core/scoring.py +436 -0
  61. codeprobe-0.1.0a1/src/codeprobe/loaders/__init__.py +143 -0
  62. codeprobe-0.1.0a1/src/codeprobe/mining/__init__.py +14 -0
  63. codeprobe-0.1.0a1/src/codeprobe/mining/extractor.py +721 -0
  64. codeprobe-0.1.0a1/src/codeprobe/mining/sources.py +118 -0
  65. codeprobe-0.1.0a1/src/codeprobe/mining/writer.py +143 -0
  66. codeprobe-0.1.0a1/src/codeprobe/models/__init__.py +16 -0
  67. codeprobe-0.1.0a1/src/codeprobe/models/evalrc.py +18 -0
  68. codeprobe-0.1.0a1/src/codeprobe/models/experiment.py +58 -0
  69. codeprobe-0.1.0a1/src/codeprobe/models/preamble.py +28 -0
  70. codeprobe-0.1.0a1/src/codeprobe/models/task.py +49 -0
  71. codeprobe-0.1.0a1/src/codeprobe/preambles/__init__.py +52 -0
  72. codeprobe-0.1.0a1/src/codeprobe/preambles/sourcegraph.md +32 -0
  73. codeprobe-0.1.0a1/src/codeprobe/probe/__init__.py +1 -0
  74. codeprobe-0.1.0a1/src/codeprobe/probe/generator.py +623 -0
  75. codeprobe-0.1.0a1/src/codeprobe/probe/writer.py +178 -0
  76. codeprobe-0.1.0a1/src/codeprobe/ratings/__init__.py +1 -0
  77. codeprobe-0.1.0a1/src/codeprobe/ratings/collector.py +263 -0
  78. codeprobe-0.1.0a1/src/codeprobe/scaffold/__init__.py +1 -0
  79. codeprobe-0.1.0a1/src/codeprobe/scaffold/writer.py +180 -0
  80. codeprobe-0.1.0a1/src/codeprobe/templates/__init__.py +1 -0
  81. codeprobe-0.1.0a1/src/codeprobe/templates/evalrc-mcp-comparison.yaml +28 -0
  82. codeprobe-0.1.0a1/src/codeprobe/templates/evalrc-model-comparison.yaml +18 -0
  83. codeprobe-0.1.0a1/src/codeprobe/templates/evalrc-prompt-comparison.yaml +18 -0
  84. codeprobe-0.1.0a1/src/codeprobe.egg-info/PKG-INFO +103 -0
  85. codeprobe-0.1.0a1/src/codeprobe.egg-info/SOURCES.txt +113 -0
  86. codeprobe-0.1.0a1/src/codeprobe.egg-info/dependency_links.txt +1 -0
  87. codeprobe-0.1.0a1/src/codeprobe.egg-info/entry_points.txt +14 -0
  88. codeprobe-0.1.0a1/src/codeprobe.egg-info/requires.txt +27 -0
  89. codeprobe-0.1.0a1/src/codeprobe.egg-info/top_level.txt +1 -0
  90. codeprobe-0.1.0a1/tests/test_adapters.py +1582 -0
  91. codeprobe-0.1.0a1/tests/test_analysis.py +1455 -0
  92. codeprobe-0.1.0a1/tests/test_api.py +197 -0
  93. codeprobe-0.1.0a1/tests/test_assess.py +542 -0
  94. codeprobe-0.1.0a1/tests/test_checkpoint.py +376 -0
  95. codeprobe-0.1.0a1/tests/test_cli.py +50 -0
  96. codeprobe-0.1.0a1/tests/test_config_loader.py +325 -0
  97. codeprobe-0.1.0a1/tests/test_contrib.py +391 -0
  98. codeprobe-0.1.0a1/tests/test_executor.py +1121 -0
  99. codeprobe-0.1.0a1/tests/test_experiment_cmd.py +276 -0
  100. codeprobe-0.1.0a1/tests/test_experiment_core.py +139 -0
  101. codeprobe-0.1.0a1/tests/test_init_wizard.py +317 -0
  102. codeprobe-0.1.0a1/tests/test_llm.py +185 -0
  103. codeprobe-0.1.0a1/tests/test_loaders.py +364 -0
  104. codeprobe-0.1.0a1/tests/test_mining.py +1373 -0
  105. codeprobe-0.1.0a1/tests/test_models.py +90 -0
  106. codeprobe-0.1.0a1/tests/test_openai_compat.py +428 -0
  107. codeprobe-0.1.0a1/tests/test_preamble.py +336 -0
  108. codeprobe-0.1.0a1/tests/test_probe.py +435 -0
  109. codeprobe-0.1.0a1/tests/test_ratings.py +248 -0
  110. codeprobe-0.1.0a1/tests/test_ratings_cmd.py +189 -0
  111. codeprobe-0.1.0a1/tests/test_registry.py +40 -0
  112. codeprobe-0.1.0a1/tests/test_scaffold.py +327 -0
  113. codeprobe-0.1.0a1/tests/test_scoring.py +540 -0
  114. codeprobe-0.1.0a1/tests/test_session.py +366 -0
  115. codeprobe-0.1.0a1/tests/test_telemetry.py +474 -0
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by the Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding any notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2024-2026 codeprobe contributors
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,103 @@
1
+ Metadata-Version: 2.4
2
+ Name: codeprobe
3
+ Version: 0.1.0a1
4
+ Summary: Benchmark AI coding agents against your own codebase. Mine real tasks from repo history, run agents, interpret results.
5
+ Author: codeprobe contributors
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/sjarmak/codeprobe
8
+ Project-URL: Repository, https://github.com/sjarmak/codeprobe
9
+ Project-URL: Issues, https://github.com/sjarmak/codeprobe/issues
10
+ Keywords: ai,benchmark,eval,coding-agent,mcp
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Topic :: Software Development :: Testing
18
+ Requires-Python: >=3.11
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: click<9,>=8.0
22
+ Provides-Extra: yaml
23
+ Requires-Dist: pyyaml<7,>=6.0; extra == "yaml"
24
+ Provides-Extra: codex
25
+ Requires-Dist: openai>=1.66; extra == "codex"
26
+ Provides-Extra: tokens
27
+ Requires-Dist: tiktoken<1,>=0.7; extra == "tokens"
28
+ Provides-Extra: stats
29
+ Requires-Dist: scipy<2,>=1.11; extra == "stats"
30
+ Provides-Extra: all
31
+ Requires-Dist: pyyaml<7,>=6.0; extra == "all"
32
+ Requires-Dist: openai>=1.66; extra == "all"
33
+ Requires-Dist: tiktoken<1,>=0.7; extra == "all"
34
+ Requires-Dist: scipy<2,>=1.11; extra == "all"
35
+ Provides-Extra: dev
36
+ Requires-Dist: pytest<9,>=8.0; extra == "dev"
37
+ Requires-Dist: pytest-cov<6,>=5.0; extra == "dev"
38
+ Requires-Dist: ruff<1,>=0.4; extra == "dev"
39
+ Requires-Dist: mypy<2,>=1.10; extra == "dev"
40
+ Requires-Dist: types-PyYAML<7,>=6.0; extra == "dev"
41
+ Requires-Dist: scipy<2,>=1.11; extra == "dev"
42
+ Dynamic: license-file
43
+
44
+ # codeprobe
45
+
46
+ Benchmark AI coding agents against **your own codebase**.
47
+
48
+ Mine real tasks from your repo history, run agents against them, and find out which setup actually works best for YOUR code — not someone else's benchmark suite.
49
+
50
+ ## Why codeprobe?
51
+
52
+ Existing benchmarks (SWE-bench, HumanEval) use fixed task sets that AI models may have memorized from training data. codeprobe mines tasks from **your private repo history**, producing benchmarks that are impossible to contaminate.
53
+
54
+ ## Quick Start
55
+
56
+ ```bash
57
+ pip install codeprobe # Core (mine + run + interpret)
58
+ pip install codeprobe[stats] # + statistical tests (scipy)
59
+ pip install codeprobe[tokens] # + exact Copilot token counting (tiktoken)
60
+ pip install codeprobe[all] # Everything
61
+
62
+ cd /path/to/your/repo
63
+
64
+ codeprobe init # What do you want to learn?
65
+ codeprobe mine . # Extract tasks from repo history
66
+ codeprobe run . # Run agents against tasks
67
+ codeprobe interpret . # Get recommendations
68
+ ```
69
+
70
+ ## Commands
71
+
72
+ | Command | Purpose |
73
+ | --------------------- | ------------------------------------------- |
74
+ | `codeprobe init` | Interactive wizard — choose what to compare |
75
+ | `codeprobe mine` | Mine eval tasks from merged PRs/MRs |
76
+ | `codeprobe run` | Execute tasks against AI agents |
77
+ | `codeprobe interpret` | Analyze results, rank configurations |
78
+ | `codeprobe assess` | Score a codebase's benchmarking potential |
79
+
80
+ ## Supported Agents
81
+
82
+ - **Claude Code** (`--agent claude`)
83
+ - **GitHub Copilot** (`--agent copilot`)
84
+ - Custom agents via the `AgentAdapter` protocol
85
+
86
+ ## Supported Git Hosts
87
+
88
+ GitHub, GitLab, Bitbucket, Azure DevOps, Gitea/Forgejo, and local repos.
89
+
90
+ ## Configuration
91
+
92
+ Create a `.evalrc.yaml` in your repo root:
93
+
94
+ ```yaml
95
+ name: my-experiment
96
+ agents: [claude, copilot]
97
+ models: [claude-sonnet-4-6, claude-opus-4-6]
98
+ tasks_dir: .codeprobe/tasks
99
+ ```
100
+
101
+ ## License
102
+
103
+ Apache-2.0
@@ -0,0 +1,60 @@
1
+ # codeprobe
2
+
3
+ Benchmark AI coding agents against **your own codebase**.
4
+
5
+ Mine real tasks from your repo history, run agents against them, and find out which setup actually works best for YOUR code — not someone else's benchmark suite.
6
+
7
+ ## Why codeprobe?
8
+
9
+ Existing benchmarks (SWE-bench, HumanEval) use fixed task sets that AI models may have memorized from training data. codeprobe mines tasks from **your private repo history**, producing benchmarks that are impossible to contaminate.
10
+
11
+ ## Quick Start
12
+
13
+ ```bash
14
+ pip install codeprobe # Core (mine + run + interpret)
15
+ pip install codeprobe[stats] # + statistical tests (scipy)
16
+ pip install codeprobe[tokens] # + exact Copilot token counting (tiktoken)
17
+ pip install codeprobe[all] # Everything
18
+
19
+ cd /path/to/your/repo
20
+
21
+ codeprobe init # What do you want to learn?
22
+ codeprobe mine . # Extract tasks from repo history
23
+ codeprobe run . # Run agents against tasks
24
+ codeprobe interpret . # Get recommendations
25
+ ```
26
+
27
+ ## Commands
28
+
29
+ | Command | Purpose |
30
+ | --------------------- | ------------------------------------------- |
31
+ | `codeprobe init` | Interactive wizard — choose what to compare |
32
+ | `codeprobe mine` | Mine eval tasks from merged PRs/MRs |
33
+ | `codeprobe run` | Execute tasks against AI agents |
34
+ | `codeprobe interpret` | Analyze results, rank configurations |
35
+ | `codeprobe assess` | Score a codebase's benchmarking potential |
36
+
37
+ ## Supported Agents
38
+
39
+ - **Claude Code** (`--agent claude`)
40
+ - **GitHub Copilot** (`--agent copilot`)
41
+ - Custom agents via the `AgentAdapter` protocol
42
+
43
+ ## Supported Git Hosts
44
+
45
+ GitHub, GitLab, Bitbucket, Azure DevOps, Gitea/Forgejo, and local repos.
46
+
47
+ ## Configuration
48
+
49
+ Create a `.evalrc.yaml` in your repo root:
50
+
51
+ ```yaml
52
+ name: my-experiment
53
+ agents: [claude, copilot]
54
+ models: [claude-sonnet-4-6, claude-opus-4-6]
55
+ tasks_dir: .codeprobe/tasks
56
+ ```
57
+
58
+ ## License
59
+
60
+ Apache-2.0
@@ -0,0 +1,86 @@
1
+ [project]
2
+ name = "codeprobe"
3
+ version = "0.1.0a1"
4
+ description = "Benchmark AI coding agents against your own codebase. Mine real tasks from repo history, run agents, interpret results."
5
+ readme = "README.md"
6
+ license = "Apache-2.0"
7
+ requires-python = ">=3.11"
8
+ authors = [
9
+ { name = "codeprobe contributors" },
10
+ ]
11
+ keywords = ["ai", "benchmark", "eval", "coding-agent", "mcp"]
12
+ classifiers = [
13
+ "Development Status :: 3 - Alpha",
14
+ "Intended Audience :: Developers",
15
+ "Programming Language :: Python :: 3",
16
+ "Programming Language :: Python :: 3.11",
17
+ "Programming Language :: Python :: 3.12",
18
+ "Programming Language :: Python :: 3.13",
19
+ "Topic :: Software Development :: Testing",
20
+ ]
21
+ dependencies = [
22
+ "click>=8.0,<9",
23
+ ]
24
+
25
+ [project.urls]
26
+ Homepage = "https://github.com/sjarmak/codeprobe"
27
+ Repository = "https://github.com/sjarmak/codeprobe"
28
+ Issues = "https://github.com/sjarmak/codeprobe/issues"
29
+
30
+ [project.optional-dependencies]
31
+ yaml = ["pyyaml>=6.0,<7"]
32
+ codex = ["openai>=1.66"]
33
+ tokens = ["tiktoken>=0.7,<1"]
34
+ stats = ["scipy>=1.11,<2"]
35
+ all = ["pyyaml>=6.0,<7", "openai>=1.66", "tiktoken>=0.7,<1", "scipy>=1.11,<2"]
36
+ dev = [
37
+ "pytest>=8.0,<9",
38
+ "pytest-cov>=5.0,<6",
39
+ "ruff>=0.4,<1",
40
+ "mypy>=1.10,<2",
41
+ "types-PyYAML>=6.0,<7",
42
+ "scipy>=1.11,<2",
43
+ ]
44
+
45
+ [project.scripts]
46
+ codeprobe = "codeprobe.cli:main"
47
+
48
+ [project.entry-points."codeprobe.agents"]
49
+ aider = "codeprobe.adapters.aider:AiderAdapter"
50
+ claude = "codeprobe.adapters.claude:ClaudeAdapter"
51
+ codex = "codeprobe.adapters.codex:CodexAdapter"
52
+ copilot = "codeprobe.adapters.copilot:CopilotAdapter"
53
+ openai = "codeprobe.adapters.openai_compat:OpenAICompatAdapter"
54
+
55
+ [project.entry-points."codeprobe.sessions"]
56
+ claude = "codeprobe.adapters.session:ClaudeSessionCollector"
57
+ codex = "codeprobe.adapters.session:CodexSessionCollector"
58
+ copilot = "codeprobe.adapters.session:CopilotSessionCollector"
59
+
60
+ [build-system]
61
+ requires = ["setuptools>=68", "wheel"]
62
+ build-backend = "setuptools.build_meta"
63
+
64
+ [tool.setuptools.packages.find]
65
+ where = ["src"]
66
+
67
+ [tool.setuptools.package-data]
68
+ "codeprobe.preambles" = ["*.md"]
69
+ "codeprobe.templates" = ["*.yaml"]
70
+
71
+ [tool.pytest.ini_options]
72
+ testpaths = ["tests"]
73
+
74
+ [tool.mypy]
75
+ python_version = "3.11"
76
+ strict = true
77
+ warn_return_any = true
78
+ warn_unused_configs = true
79
+ disallow_any_generics = false
80
+
81
+ [tool.ruff]
82
+ target-version = "py311"
83
+ line-length = 120
84
+
85
+ [tool.ruff.lint]
86
+ select = ["E", "F", "I", "N", "W", "UP"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """codeprobe — Benchmark AI coding agents against your own codebase."""
2
+
3
+ __version__ = "0.1.0a1"
@@ -0,0 +1,5 @@
1
+ """Allow ``python -m codeprobe`` and ``pipx run codeprobe``."""
2
+
3
+ from codeprobe.cli import main
4
+
5
+ main()
@@ -0,0 +1,19 @@
1
+ """Agent adapters — Protocol + built-in implementations."""
2
+
3
+ from codeprobe.adapters.protocol import (
4
+ AdapterError,
5
+ AdapterExecutionError,
6
+ AdapterSetupError,
7
+ AgentAdapter,
8
+ AgentConfig,
9
+ AgentOutput,
10
+ )
11
+
12
+ __all__ = [
13
+ "AdapterError",
14
+ "AdapterExecutionError",
15
+ "AdapterSetupError",
16
+ "AgentAdapter",
17
+ "AgentConfig",
18
+ "AgentOutput",
19
+ ]
@@ -0,0 +1,190 @@
1
+ """Shared base for agent adapters — eliminates duplicated run/preflight logic."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import os
7
+ import shutil
8
+ import subprocess
9
+ import tempfile
10
+ import time
11
+ from abc import abstractmethod
12
+
13
+ from codeprobe.adapters.protocol import (
14
+ AdapterSetupError,
15
+ AgentConfig,
16
+ AgentOutput,
17
+ )
18
+
19
+ # Only these env vars are forwarded to agent subprocesses.
20
+ # Keeps secrets (OPENAI_API_KEY, AWS_SECRET_*, etc.) out of the child
21
+ # unless explicitly listed here.
22
+ _ADAPTER_ENV_WHITELIST: frozenset[str] = frozenset(
23
+ {
24
+ # System essentials
25
+ "PATH",
26
+ "HOME",
27
+ "LANG",
28
+ "TERM",
29
+ "TMPDIR",
30
+ "LC_ALL",
31
+ # Agent-specific API keys (required by the adapters)
32
+ "ANTHROPIC_API_KEY",
33
+ "CLAUDE_CONFIG_DIR",
34
+ "GITHUB_TOKEN",
35
+ "OPENAI_API_KEY",
36
+ "COPILOT_API_KEY",
37
+ # Python toolchain
38
+ "VIRTUAL_ENV",
39
+ "PYTHONPATH",
40
+ # Node/npm (for copilot CLI)
41
+ "NODE_PATH",
42
+ "NPM_CONFIG_PREFIX",
43
+ # Go toolchain
44
+ "GOPATH",
45
+ "GOROOT",
46
+ # Rust toolchain
47
+ "CARGO_HOME",
48
+ "RUSTUP_HOME",
49
+ }
50
+ )
51
+
52
+
53
+ def _adapter_safe_env(extra: dict[str, str] | None = None) -> dict[str, str]:
54
+ """Build a filtered environment for agent subprocesses.
55
+
56
+ Only passes whitelisted vars — prevents leaking secrets from parent env.
57
+ """
58
+ env = {k: v for k, v in os.environ.items() if k in _ADAPTER_ENV_WHITELIST}
59
+ if extra:
60
+ env.update(extra)
61
+ return env
62
+
63
+
64
+ class BaseAdapter:
65
+ """Base class for CLI-based agent adapters.
66
+
67
+ Subclasses set ``_binary_name`` and ``_install_hint``, then implement
68
+ ``build_command``. The Protocol requires ``name``, ``preflight``, and
69
+ ``run``; ``find_binary`` and ``build_command`` are BaseAdapter helpers.
70
+ """
71
+
72
+ _binary_name: str
73
+ _install_hint: str
74
+
75
+ @property
76
+ def name(self) -> str:
77
+ return self._binary_name
78
+
79
+ def find_binary(self) -> str | None:
80
+ return shutil.which(self._binary_name)
81
+
82
+ def _require_binary(self) -> str:
83
+ """Return binary path or raise AdapterSetupError."""
84
+ binary = self.find_binary()
85
+ if binary is None:
86
+ raise AdapterSetupError(f"{self._binary_name} CLI not found")
87
+ return binary
88
+
89
+ def preflight(self, config: AgentConfig) -> list[str]:
90
+ issues: list[str] = []
91
+ if self.find_binary() is None:
92
+ issues.append(self._install_hint)
93
+ return issues
94
+
95
+ def isolate_session(self, slot_id: int) -> dict[str, str]:
96
+ """Default: no session isolation env overrides."""
97
+ return {}
98
+
99
+ @abstractmethod
100
+ def build_command(self, prompt: str, config: AgentConfig) -> list[str]: ...
101
+
102
+ def parse_output(
103
+ self, result: subprocess.CompletedProcess[str], duration: float
104
+ ) -> AgentOutput:
105
+ """Convert subprocess result to AgentOutput.
106
+
107
+ Subclasses override to extract tokens, cost, etc. from agent output.
108
+ """
109
+ return AgentOutput(
110
+ stdout=result.stdout,
111
+ stderr=result.stderr or None,
112
+ exit_code=result.returncode,
113
+ duration_seconds=duration,
114
+ )
115
+
116
+ def _write_mcp_config(self, config: AgentConfig) -> str | None:
117
+ """Write MCP config to a temp file if present. Returns path or None.
118
+
119
+ Expands ``${VAR}`` references in string values from the environment
120
+ so experiment.json can reference secrets without hardcoding them.
121
+ """
122
+ if not config.mcp_config:
123
+ return None
124
+ expanded = json.loads(os.path.expandvars(json.dumps(config.mcp_config)))
125
+ tmp = tempfile.NamedTemporaryFile(
126
+ mode="w", suffix=".json", prefix="codeprobe-mcp-", delete=False
127
+ )
128
+ json.dump(expanded, tmp)
129
+ tmp.close()
130
+ return tmp.name
131
+
132
+ def run(
133
+ self,
134
+ prompt: str,
135
+ config: AgentConfig,
136
+ session_env: dict[str, str] | None = None,
137
+ ) -> AgentOutput:
138
+ cmd = self.build_command(prompt, config)
139
+ mcp_tmpfile: str | None = None
140
+
141
+ # Find and track MCP temp file for cleanup
142
+ for flag in ("--mcp-config", "--additional-mcp-config"):
143
+ if flag in cmd:
144
+ idx = cmd.index(flag)
145
+ if idx + 1 < len(cmd):
146
+ path = cmd[idx + 1]
147
+ if path.startswith(tempfile.gettempdir()):
148
+ mcp_tmpfile = path
149
+
150
+ start = time.monotonic()
151
+
152
+ try:
153
+ result = subprocess.run(
154
+ cmd,
155
+ capture_output=True,
156
+ text=True,
157
+ timeout=config.timeout_seconds,
158
+ cwd=config.cwd,
159
+ env=_adapter_safe_env(session_env),
160
+ )
161
+ except subprocess.TimeoutExpired as exc:
162
+ duration = time.monotonic() - start
163
+ return AgentOutput(
164
+ stdout=exc.stdout if isinstance(exc.stdout, str) else "",
165
+ stderr=exc.stderr if isinstance(exc.stderr, str) else None,
166
+ exit_code=-1,
167
+ duration_seconds=duration,
168
+ error=f"Agent timed out after {config.timeout_seconds}s",
169
+ )
170
+ except FileNotFoundError as exc:
171
+ raise AdapterSetupError(f"Binary not found at runtime: {exc}") from exc
172
+ finally:
173
+ if mcp_tmpfile:
174
+ try:
175
+ os.unlink(mcp_tmpfile)
176
+ except OSError:
177
+ pass
178
+
179
+ duration = time.monotonic() - start
180
+
181
+ try:
182
+ return self.parse_output(result, duration)
183
+ except Exception as exc:
184
+ return AgentOutput(
185
+ stdout=result.stdout,
186
+ stderr=result.stderr or None,
187
+ exit_code=result.returncode,
188
+ duration_seconds=duration,
189
+ error=f"Output parse failed: {exc}",
190
+ )