code-search-cli 0.1.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.
- code_search_cli-0.1.0/LICENSE +202 -0
- code_search_cli-0.1.0/NOTICE +7 -0
- code_search_cli-0.1.0/PKG-INFO +287 -0
- code_search_cli-0.1.0/README.md +266 -0
- code_search_cli-0.1.0/pyproject.toml +35 -0
- code_search_cli-0.1.0/setup.cfg +4 -0
- code_search_cli-0.1.0/src/code_retrieval/__init__.py +6 -0
- code_search_cli-0.1.0/src/code_retrieval/__main__.py +3 -0
- code_search_cli-0.1.0/src/code_retrieval/cli.py +144 -0
- code_search_cli-0.1.0/src/code_retrieval/engine.py +722 -0
- code_search_cli-0.1.0/src/code_retrieval/index_store.py +286 -0
- code_search_cli-0.1.0/src/code_retrieval/installer.py +65 -0
- code_search_cli-0.1.0/src/code_retrieval/models.py +90 -0
- code_search_cli-0.1.0/src/code_retrieval/query.py +61 -0
- code_search_cli-0.1.0/src/code_retrieval/repository.py +161 -0
- code_search_cli-0.1.0/src/code_retrieval/resources/code-search/SKILL.md +47 -0
- code_search_cli-0.1.0/src/code_retrieval/resources/code-search/agents/openai.yaml +4 -0
- code_search_cli-0.1.0/src/code_retrieval/structure.py +115 -0
- code_search_cli-0.1.0/src/code_search_cli.egg-info/PKG-INFO +287 -0
- code_search_cli-0.1.0/src/code_search_cli.egg-info/SOURCES.txt +28 -0
- code_search_cli-0.1.0/src/code_search_cli.egg-info/dependency_links.txt +1 -0
- code_search_cli-0.1.0/src/code_search_cli.egg-info/entry_points.txt +2 -0
- code_search_cli-0.1.0/src/code_search_cli.egg-info/top_level.txt +1 -0
- code_search_cli-0.1.0/tests/test_benchmark_scripts.py +143 -0
- code_search_cli-0.1.0/tests/test_engine.py +191 -0
- code_search_cli-0.1.0/tests/test_index_store.py +97 -0
- code_search_cli-0.1.0/tests/test_installer.py +64 -0
- code_search_cli-0.1.0/tests/test_query.py +21 -0
- code_search_cli-0.1.0/tests/test_release_hygiene.py +43 -0
- code_search_cli-0.1.0/tests/test_structure.py +29 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Code Search
|
|
2
|
+
Copyright 2026 Code Search contributors
|
|
3
|
+
|
|
4
|
+
This product is licensed under the Apache License, Version 2.0.
|
|
5
|
+
|
|
6
|
+
Semble and code-review-graph are independent projects referenced only as
|
|
7
|
+
research and evaluation baselines. Their code is not included in this product.
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: code-search-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Task-aware, evidence-oriented local code retrieval
|
|
5
|
+
Author: Code Search contributors
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/quguai/code-search
|
|
8
|
+
Project-URL: Repository, https://github.com/quguai/code-search
|
|
9
|
+
Project-URL: Issues, https://github.com/quguai/code-search/issues
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Topic :: Software Development
|
|
16
|
+
Requires-Python: >=3.11
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
License-File: NOTICE
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
<div align="center">
|
|
23
|
+
<a href="https://github.com/quguai/code-search">
|
|
24
|
+
<picture>
|
|
25
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/quguai/code-search/main/assets/brand-dark.png" />
|
|
26
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/quguai/code-search/main/assets/brand-light.png" />
|
|
27
|
+
<img src="https://raw.githubusercontent.com/quguai/code-search/main/assets/brand-light.png" alt="CodeSearch" width="600" />
|
|
28
|
+
</picture>
|
|
29
|
+
</a>
|
|
30
|
+
<p><strong>Task-aware code search for coding agents</strong></p>
|
|
31
|
+
<p>Accurate evidence. Smaller context. No runtime model.</p>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<p align="center">
|
|
35
|
+
<a href="https://github.com/quguai/code-search/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/quguai/code-search/ci.yml?branch=main&style=flat-square" /></a>
|
|
36
|
+
<a href="https://github.com/quguai/code-search/blob/main/LICENSE"><img alt="Apache-2.0 license" src="https://img.shields.io/github/license/quguai/code-search?style=flat-square" /></a>
|
|
37
|
+
<img alt="Python 3.11+" src="https://img.shields.io/badge/Python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white" />
|
|
38
|
+
<img alt="Codex skill included" src="https://img.shields.io/badge/Codex-skill_included-5B47D6?style=flat-square" />
|
|
39
|
+
<img alt="Experimental status" src="https://img.shields.io/badge/status-experimental-D97706?style=flat-square" />
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
<p align="center">
|
|
43
|
+
<strong>English</strong> | <a href="https://github.com/quguai/code-search/blob/main/README.zh-CN.md">简体中文</a> | <a href="https://github.com/quguai/code-search/blob/main/README.ja-JP.md">日本語</a> | <a href="https://github.com/quguai/code-search/blob/main/README.ko-KR.md">한국어</a> | <a href="https://github.com/quguai/code-search/blob/main/README.ru-RU.md">Русский</a>
|
|
44
|
+
</p>
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
Code Search is a task-aware retrieval CLI for coding agents. It returns a concise, verifiable set of
|
|
49
|
+
source evidence for an engineering task—not only a list of similar snippets.
|
|
50
|
+
|
|
51
|
+
The current release is an independently implemented, no-runtime-model MVP. It can read a working tree
|
|
52
|
+
or any Git revision and returns source locations, ranking reasons, structural evidence roles, and
|
|
53
|
+
payload statistics.
|
|
54
|
+
|
|
55
|
+
> Search less. Hand the agent the evidence it needs to act.
|
|
56
|
+
|
|
57
|
+
## Quick start
|
|
58
|
+
|
|
59
|
+
### Install from this checkout
|
|
60
|
+
|
|
61
|
+
The complete local flow works today:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
cd /path/to/code-search
|
|
65
|
+
uv tool install .
|
|
66
|
+
code-search install
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`code-search install` installs the bundled `code-search` skill into Codex. Restart Codex after the
|
|
70
|
+
command so it can discover the skill. The installer is idempotent and refuses to overwrite a locally
|
|
71
|
+
modified skill unless `--force` is supplied.
|
|
72
|
+
|
|
73
|
+
After the first PyPI release, the first command becomes:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
uv tool install code-search-cli
|
|
77
|
+
code-search install
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The PyPI distribution name (`code-search-cli`) and CLI entry point (`code-search`) are ready, but this
|
|
81
|
+
repository has not been published to PyPI yet.
|
|
82
|
+
|
|
83
|
+
### Retrieve evidence for a task
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
code-search retrieve \
|
|
87
|
+
--repo /path/to/repository \
|
|
88
|
+
--task "Fix dependency injection order so startup events are not missed"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The command is read-only. It does not check out revisions, modify the target repository, or create an
|
|
92
|
+
index inside it. It incrementally maintains a per-user SQLite index under the operating-system cache
|
|
93
|
+
directory; use `code-search clean` to remove the cached source snapshot and derived metadata.
|
|
94
|
+
|
|
95
|
+
## What you get
|
|
96
|
+
|
|
97
|
+
- A concise, de-duplicated evidence set instead of an unbounded list of matches.
|
|
98
|
+
- Source locations, scores, inclusion reasons, and estimated token cost for every result.
|
|
99
|
+
- Lightweight structural obligations for lifecycle, event, dependency-ordering, and test evidence.
|
|
100
|
+
- Direct reads from a working tree or historical Git revision without changing the checkout.
|
|
101
|
+
- A persistent incremental index that reuses unchanged source terms and structural boundaries.
|
|
102
|
+
- Java, Python, JavaScript, and TypeScript structural extraction with no runtime model dependency.
|
|
103
|
+
- A bundled Codex skill that teaches the agent when to retrieve, expand, or fall back to exact `rg`.
|
|
104
|
+
|
|
105
|
+
## CLI
|
|
106
|
+
|
|
107
|
+
Read a historical revision:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
code-search retrieve \
|
|
111
|
+
--repo /path/to/repository \
|
|
112
|
+
--ref HEAD~1 \
|
|
113
|
+
--task "Resolve NullPointerException in scheduled dump" \
|
|
114
|
+
--format json
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Expand a known anchor to its enclosing unit, siblings, or references:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
code-search expand \
|
|
121
|
+
--repo /path/to/repository \
|
|
122
|
+
--path src/main/java/example/Service.java \
|
|
123
|
+
--line 120 \
|
|
124
|
+
--relation enclosing
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Manage the Codex skill:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
code-search install
|
|
131
|
+
code-search uninstall
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Prewarm, inspect, or remove the per-repository index:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
code-search index --repo /path/to/repository
|
|
138
|
+
code-search status --repo /path/to/repository
|
|
139
|
+
code-search clean --repo /path/to/repository
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Benchmarks
|
|
143
|
+
|
|
144
|
+
The primary benchmark uses `NDCG@10`, `Recall@10`, `MRR@10`, latency, and Top-10 payload size. The
|
|
145
|
+
local shared subset contains 61 queries over pinned revisions of Gson, Apache Commons Lang, and
|
|
146
|
+
Jackson Databind. Semble's published 1,251-query results are kept in a separate table and are not
|
|
147
|
+
presented as a local rerun.
|
|
148
|
+
|
|
149
|
+
<!-- benchmark-results:start -->
|
|
150
|
+
#### Local four-axis scorecard
|
|
151
|
+
|
|
152
|
+

|
|
153
|
+
|
|
154
|
+
### Local shared Java subset
|
|
155
|
+
|
|
156
|
+
| Method | NDCG@10 | Recall@10 | MRR@10 | Warm p50 | Top-10 payload |
|
|
157
|
+
|---|---:|---:|---:|---:|---:|
|
|
158
|
+
| Semble | **0.8250** | **0.9754** | **0.7852** | 4.25 ms | 1,803 tok |
|
|
159
|
+
| code-review-graph | 0.7634 | 0.8607 | 0.7670 | 103.30 ms | 16,162 tok |
|
|
160
|
+
| Code Search MVP | 0.7217 | 0.8525 | 0.6970 | 38.08 ms | 2,490 tok |
|
|
161
|
+
| BM25 | 0.5686 | 0.7623 | 0.5398 | **0.72 ms** | **1,752 tok** |
|
|
162
|
+
| probe | 0.2044 | 0.4262 | 0.1453 | 1,764.40 ms | 5,537 tok |
|
|
163
|
+
| ripgrep | 0.1977 | 0.2377 | 0.1904 | 30.84 ms | 28,605 tok |
|
|
164
|
+
|
|
165
|
+
### Published full-suite reference (not a local rerun)
|
|
166
|
+
|
|
167
|
+
These values are reported by Semble for its 1,251-query, 63-repository, 19-language benchmark.
|
|
168
|
+
|
|
169
|
+
| Method | NDCG@10 | Cold first result | Model size |
|
|
170
|
+
|---|---:|---:|---:|
|
|
171
|
+
| CodeRankEmbed Hybrid | 0.8617 | 57.29 s | 137M |
|
|
172
|
+
| semble | 0.8544 | 264.09 ms | 16M |
|
|
173
|
+
| CodeRankEmbed | 0.7648 | 57.29 s | 137M |
|
|
174
|
+
| ColGREP | 0.6925 | 5.87 s | 16M |
|
|
175
|
+
| BM25 | 0.6730 | 262.62 ms | no model |
|
|
176
|
+
| grepai | 0.5610 | 35.00 s | 137M |
|
|
177
|
+
| probe | 0.3870 | 207.10 ms | no model |
|
|
178
|
+
| ripgrep | 0.1260 | 12.08 ms | no model |
|
|
179
|
+
<!-- benchmark-results:end -->
|
|
180
|
+
|
|
181
|
+
Regenerate the scorecard and synchronize the measured JSON values into both READMEs:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
uv run --no-project --with matplotlib python scripts/publish_shared_benchmark.py
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
This command does not rerun the benchmark or publish a package. See the
|
|
188
|
+
[shared benchmark methodology](https://github.com/quguai/code-search/blob/main/benchmarks/shared-java/README.md),
|
|
189
|
+
[raw local results](https://github.com/quguai/code-search/blob/main/benchmarks/shared-java/RESULTS.json), and
|
|
190
|
+
[published-reference provenance](https://github.com/quguai/code-search/blob/main/benchmarks/shared-java/PUBLISHED_REFERENCE.json).
|
|
191
|
+
|
|
192
|
+
The unit test suite creates only temporary synthetic repositories. The shared benchmark uses public,
|
|
193
|
+
pinned Gson, Apache Commons Lang, and Jackson Databind revisions with Semble's public annotations.
|
|
194
|
+
Machine-local and private development tasks are deliberately excluded from the public repository.
|
|
195
|
+
|
|
196
|
+
## How it differs from Semble and code-review-graph
|
|
197
|
+
|
|
198
|
+
The projects overlap, but optimize different parts of an agent workflow. This comparison describes
|
|
199
|
+
their public product shape; it is not a claim that one implementation dominates every task.
|
|
200
|
+
|
|
201
|
+
| | Code Search | Semble | code-review-graph |
|
|
202
|
+
|---|---|---|---|
|
|
203
|
+
| Primary job | Assemble task-relevant, explainable evidence | Find relevant code chunks quickly | Persist code relations for review, impact, and multi-hop exploration |
|
|
204
|
+
| Result shape | Evidence bundle with source, reason, score, and structural role | Compact ranked code snippets | Graph nodes, relations, traversals, and review reports |
|
|
205
|
+
| Retrieval | Lexical and task-aware structural retrieval; no runtime model today | Code-aware chunks, semantic retrieval, BM25, fusion, and reranking | Structural graph plus full-text/vector hybrid search |
|
|
206
|
+
| Structure/history | Persistent incremental local index, lightweight expansion, and direct reads from any Git revision | Similar-chunk retrieval and cached working-tree indexes | Persistent incremental graph, callers, flows, communities, and impact analysis |
|
|
207
|
+
| Onboarding | CLI plus a bundled Codex skill installer | CLI installer for MCP, instructions, and search sub-agents across multiple agents | CLI, MCP, daemon, GitHub Action, and review workflows |
|
|
208
|
+
| Best fit today | Explainable task-evidence experiments | Fast general-purpose natural-language code search | Review and durable multi-hop structural questions |
|
|
209
|
+
|
|
210
|
+
Semble still has the broader onboarding path. Its `install` command can configure MCP, generated
|
|
211
|
+
instructions, or a dedicated sub-agent across several coding agents. `code-search install` currently
|
|
212
|
+
installs one Codex skill. Code Search intentionally uses CLI + skill as its primary interface; an MCP
|
|
213
|
+
server is optional, not a prerequisite.
|
|
214
|
+
|
|
215
|
+
### Current advantages
|
|
216
|
+
|
|
217
|
+
- **Task roles, not only similarity.** Lifecycle, registration, publication, ordering, and test
|
|
218
|
+
evidence are represented separately instead of returning only one cluster of similar chunks.
|
|
219
|
+
- **Missing-behavior evidence.** For callback tasks, structurally similar sibling methods can expose
|
|
220
|
+
an expected publication step that is absent from the target path, instead of rewarding only code
|
|
221
|
+
that already contains the queried behavior.
|
|
222
|
+
- **Causal repair sets.** Startup-order tasks can connect a publisher, a lazily initialized static
|
|
223
|
+
subscriber, and the lifecycle owner whose dependency declaration must change, marking each
|
|
224
|
+
independently actionable production file.
|
|
225
|
+
- **Auditable evidence.** Each unit includes its location, reason, score, and estimated token cost.
|
|
226
|
+
- **Historical and no-model operation.** It can inspect a Git revision without checkout and has no
|
|
227
|
+
runtime model dependency.
|
|
228
|
+
- **Smaller output than the current graph adapter.** On the shared subset, Code Search returns a
|
|
229
|
+
2,490-token Top-10 payload versus 16,162 tokens for code-review-graph.
|
|
230
|
+
|
|
231
|
+
### Where competitors still lead
|
|
232
|
+
|
|
233
|
+
Semble leads this MVP on ranking quality, token efficiency, warm latency, and integration breadth.
|
|
234
|
+
code-review-graph provides deeper persistent relations, incremental graph maintenance, and review
|
|
235
|
+
automation. Code Search does not currently claim an overall win over either project.
|
|
236
|
+
|
|
237
|
+
## How it works
|
|
238
|
+
|
|
239
|
+
The engine incrementally caches source terms and structural boundaries, splits identifiers, expands
|
|
240
|
+
engineering aliases, scores paths and content, identifies task-specific structural obligations,
|
|
241
|
+
contrasts related sibling methods when a callback path is missing expected behavior, detects missing
|
|
242
|
+
subscriber-initialization and dependency edges, focuses long methods into query-aware windows, expands
|
|
243
|
+
selected anchors, and packs non-duplicate evidence into a ranked result set. The differentiating thesis is:
|
|
244
|
+
|
|
245
|
+
> Return not only similar code, but the evidence subgraph required to answer the engineering task.
|
|
246
|
+
|
|
247
|
+
This is currently a transparent lexical/structural baseline. Independently implemented dense retrieval
|
|
248
|
+
and stronger parsers remain future work.
|
|
249
|
+
|
|
250
|
+
## Documentation
|
|
251
|
+
|
|
252
|
+
- [Competitive analysis](https://github.com/quguai/code-search/blob/main/docs/competitive-analysis.md)
|
|
253
|
+
- [Product thesis and proposed architecture](https://github.com/quguai/code-search/blob/main/docs/product-thesis.md)
|
|
254
|
+
- [MVP implementation](https://github.com/quguai/code-search/blob/main/docs/implementation.md)
|
|
255
|
+
- [Evaluation plan](https://github.com/quguai/code-search/blob/main/docs/evaluation-plan.md)
|
|
256
|
+
- [Open benchmark and adapters](https://github.com/quguai/code-search/blob/main/docs/benchmarking.md)
|
|
257
|
+
- [Shared Java benchmark](https://github.com/quguai/code-search/blob/main/benchmarks/shared-java/README.md)
|
|
258
|
+
- [PyPI release process](https://github.com/quguai/code-search/blob/main/docs/releasing.md)
|
|
259
|
+
|
|
260
|
+
## Current gaps
|
|
261
|
+
|
|
262
|
+
- **P0 — public held-out validation:** publish at least 30 untouched, license-compatible tasks with
|
|
263
|
+
executable patch tests and repeated model runs.
|
|
264
|
+
- **P1 — retrieval quality:** add independently implemented optional dense retrieval and stronger
|
|
265
|
+
AST/symbol parsers.
|
|
266
|
+
- **P1 — onboarding breadth:** add safe CLI/skill installers for more coding agents. Consider MCP only
|
|
267
|
+
if a resident index or structured tool discovery provides a measured benefit over CLI invocation.
|
|
268
|
+
- **P2 — distribution:** publish to PyPI and ship signed standalone binaries. Until publication,
|
|
269
|
+
`uv tool install code-search-cli` cannot install this project from the public registry.
|
|
270
|
+
|
|
271
|
+
## Status and independent implementation
|
|
272
|
+
|
|
273
|
+
This is a testable experimental MVP, not a production release. It reaches `0.7217 NDCG@10` on the
|
|
274
|
+
61-query shared Java subset versus Semble at `0.8250`; Recall@10 is `0.8525`, and warm query p50 is
|
|
275
|
+
38.08 ms. These public results measure retrieval, not executable patch success, and are not a held-out
|
|
276
|
+
production claim.
|
|
277
|
+
|
|
278
|
+
The project is inspired by [Semble](https://github.com/MinishLab/semble) and
|
|
279
|
+
[code-review-graph](https://github.com/tirth8205/code-review-graph), which are used as public baselines.
|
|
280
|
+
It does not copy or rewrite their source, tests, prompts, documentation, interfaces, or distinctive
|
|
281
|
+
command vocabulary. The implementation and bundled Codex skill are independently designed around this
|
|
282
|
+
project's task-evidence workflow.
|
|
283
|
+
|
|
284
|
+
## License
|
|
285
|
+
|
|
286
|
+
Licensed under the [Apache License 2.0](https://github.com/quguai/code-search/blob/main/LICENSE). Semble and code-review-graph are independent projects;
|
|
287
|
+
their code is not included here.
|