rag-your-code 0.4.2__tar.gz → 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {rag_your_code-0.4.2/src/rag_your_code.egg-info → rag_your_code-0.6.0}/PKG-INFO +74 -16
  2. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/README.md +73 -15
  3. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/pyproject.toml +1 -1
  4. {rag_your_code-0.4.2 → rag_your_code-0.6.0/src/rag_your_code.egg-info}/PKG-INFO +74 -16
  5. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/src/rag_your_code.egg-info/SOURCES.txt +5 -0
  6. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/src/ragyourcode/__init__.py +1 -1
  7. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/src/ragyourcode/agentic.py +7 -0
  8. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/src/ragyourcode/annotate.py +11 -0
  9. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/src/ragyourcode/cli.py +108 -12
  10. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/src/ragyourcode/config.py +51 -0
  11. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/src/ragyourcode/descriptions.py +125 -11
  12. rag_your_code-0.6.0/src/ragyourcode/document.py +261 -0
  13. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/src/ragyourcode/embeddings.py +22 -0
  14. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/src/ragyourcode/graph.py +40 -0
  15. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/src/ragyourcode/indexer.py +96 -17
  16. rag_your_code-0.6.0/src/ragyourcode/models.py +123 -0
  17. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/src/ragyourcode/parser.py +148 -0
  18. rag_your_code-0.6.0/src/ragyourcode/search.py +278 -0
  19. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/tests/test_config.py +1 -1
  20. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/tests/test_descriptions.py +5 -1
  21. rag_your_code-0.6.0/tests/test_doc_comments.py +215 -0
  22. rag_your_code-0.6.0/tests/test_document.py +211 -0
  23. rag_your_code-0.6.0/tests/test_ranking.py +202 -0
  24. rag_your_code-0.6.0/tests/test_repo_queries.py +107 -0
  25. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/tests/test_retrieval_correctness.py +4 -22
  26. rag_your_code-0.4.2/src/ragyourcode/models.py +0 -86
  27. rag_your_code-0.4.2/src/ragyourcode/search.py +0 -131
  28. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/LICENSE +0 -0
  29. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/setup.cfg +0 -0
  30. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/src/rag_your_code.egg-info/dependency_links.txt +0 -0
  31. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/src/rag_your_code.egg-info/entry_points.txt +0 -0
  32. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/src/rag_your_code.egg-info/requires.txt +0 -0
  33. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/src/rag_your_code.egg-info/top_level.txt +0 -0
  34. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/src/ragyourcode/py.typed +0 -0
  35. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/tests/test_agent_protocol.py +0 -0
  36. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/tests/test_agentic.py +0 -0
  37. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/tests/test_e2e_cli.py +0 -0
  38. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/tests/test_golden.py +0 -0
  39. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/tests/test_graph_incremental.py +0 -0
  40. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/tests/test_language_fixtures.py +0 -0
  41. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/tests/test_large_repo.py +0 -0
  42. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/tests/test_metadata.py +0 -0
  43. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/tests/test_multilanguage.py +0 -0
  44. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/tests/test_parser_edges.py +0 -0
  45. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/tests/test_ragyourcode.py +0 -0
  46. {rag_your_code-0.4.2 → rag_your_code-0.6.0}/tests/test_resilience.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rag-your-code
3
- Version: 0.4.2
3
+ Version: 0.6.0
4
4
  Summary: A local, explainable RAG index for codebases and coding agents
5
5
  Author: rag-your-code contributors
6
6
  License-Expression: MIT
@@ -153,7 +153,15 @@ callees listed, the docstring appended. It introduces no vocabulary the source
153
153
  did not already have — which is exactly why retrieval cannot reach a concept
154
154
  nobody wrote down.
155
155
 
156
- The agent already reading the index can supply those words:
156
+ **First, the documentation you already wrote is indexed.** Fourteen of the
157
+ fifteen supported languages put documentation immediately above a declaration
158
+ — JSDoc, Javadoc, KDoc, rustdoc, Go doc comments, XML doc comments, PHPDoc —
159
+ and a unit's span begins at the declaration, so all of it used to sit outside
160
+ the index. The same sentence reached thirteen searchable words as a Python
161
+ docstring and two as a JavaScript comment. Now both reach thirteen. Commented-
162
+ out code, separator rules and licence headers are deliberately left out.
163
+
164
+ **Where there is none, the agent can write it:**
157
165
 
158
166
  ```bash
159
167
  rag-your-code describe status # coverage, and what is pending
@@ -165,23 +173,73 @@ rag-your-code index . # apply it
165
173
  or, in the protocol, `describe_pending` and `describe_put` — which take effect
166
174
  in the same session, with no refresh.
167
175
 
176
+ **And you can move it into the code**, where it needs no bookkeeping at all:
177
+
178
+ ```bash
179
+ rag-your-code describe promote | git apply # review it first
180
+ ```
181
+
182
+ That emits a unified diff adding a doc comment in each language's own
183
+ convention, for declarations that have none. The tool still never writes your
184
+ source. Only the half meant for a reader is promoted, so a bilingual
185
+ description leaves its second language in the store where retrieval still uses
186
+ it — measured, promoting all 68 on this repository discarded no description
187
+ and left Chinese retrieval unchanged.
188
+
168
189
  ### Measured on this repository
169
190
 
170
- This project describes its own implementation: all 120 units under `src/`
171
- carry an agent-written bilingual description, committed to the repo. Ten
172
- natural-language questions about the codebase, before and after:
191
+ This project describes its own implementation: every unit under `src/` carries
192
+ an agent-written bilingual description, committed to the repo, and 68 of them
193
+ have been promoted into the source as doc comments.
173
194
 
174
- | | before | after |
175
- |---|---|---|
176
- | top result in the expected file | 2 / 8 | **6 / 8** |
177
- | Chinese-language queries | 0 / 4 | **3 / 4** |
178
- | queries with **no shared word at all** (pure fallback) | 4 | **0** |
195
+ Seventy natural-language questions about this codebase, in English and
196
+ Chinese, each listing every unit that genuinely answers it
197
+ ([`benchmarks/repo_queries.json`](benchmarks/repo_queries.json)):
179
198
 
180
- Two still miss, and both are worth stating. One query says `catastrophic
181
- backtracking` where the description says `backtracks catastrophically`: there
182
- is no stemming, so those share no word — exactly the limit documented above.
183
- The other returned a unit that answers the question from a different file than
184
- predicted, so the expectation was wrong rather than the retrieval.
199
+ | | generated descriptions | agent-written |
200
+ |---|---|---|
201
+ | hit@1 | 0.271 | **0.500** |
202
+ | hit@3 | 0.486 | **0.800** |
203
+ | MRR | 0.367 | **0.631** |
204
+ | answered with no shared word at all | 12.9% | **0%** |
205
+
206
+ Roughly double the first-place accuracy. Fourteen questions still fail, which
207
+ is what makes the set usable for measuring the next change;
208
+ `tests/test_repo_queries.py` asserts that some question always does, and that
209
+ the written column beats the generated one.
210
+
211
+ One failure is worth naming: a query saying `catastrophic backtracking` does
212
+ not reach a description saying `backtracks catastrophically`. There is no
213
+ stemming — exactly the limit documented above.
214
+
215
+ ### Measured on a repository nobody here wrote
216
+
217
+ The table above is the warmest case this project supports: its own code, its
218
+ own descriptions, and questions written by the same party. It cannot say what
219
+ a first-time user gets. So there is a second ruler — thirty-five questions
220
+ about [cc-enforcer](https://github.com/skymanbp/cc-enforcer), 1153 units, no
221
+ descriptions at all, each question phrased in a user's words rather than in
222
+ the words of the docstring that answers it
223
+ ([`benchmarks/cold_queries.json`](benchmarks/cold_queries.json)):
224
+
225
+ | | before 0.6.0 | now |
226
+ |---|---|---|
227
+ | hit@1 | 0.086 | **0.257** |
228
+ | hit@3 | 0.229 | **0.400** |
229
+ | MRR | 0.157 | **0.314** |
230
+
231
+ Three times the first-place accuracy, and the same change moved both other
232
+ rulers in the same direction. What it fixed was ranking: scoring used to be
233
+ the fraction of query words a unit contained, so `the` counted for as much as
234
+ `daemon`, and nothing corrected for size — the single largest declaration in
235
+ that repository came back in the top three for four questions out of six. It
236
+ is now BM25 over weighted fields, where a word's worth comes from how rare it
237
+ is in *your* corpus and a word in a declaration's name outweighs the same word
238
+ buried in a body.
239
+
240
+ Twenty-one of the thirty-five still fail, and the largest remaining cause is
241
+ named in [docs/TESTING.md](docs/TESTING.md): a test declaration often outranks
242
+ the code it tests, because it repeats that code's vocabulary and adds its own.
185
243
 
186
244
  **What this is:** it moves the semantic work from query time to index time.
187
245
  Matching stays lexical. It is LLM-authored keyword expansion, and its reach is
@@ -230,7 +288,7 @@ Directional local measurements, not service levels; the archived run is
230
288
  **Suite:** Python 3.10 – 3.13 on Linux and Windows, plus a job that installs
231
289
  the built wheel into a clean environment and runs every command the
232
290
  documentation prescribes, and another that runs the skill's own install line
233
- verbatim. 208 tests as of 0.4.2 — the count is version-stamped rather than
291
+ verbatim. 248 tests as of 0.5.0 — the count is version-stamped rather than
234
292
  maintained, because a bare figure in a living document is a claim that rots;
235
293
  per-release counts are in [CHANGELOG.md](CHANGELOG.md).
236
294
 
@@ -126,7 +126,15 @@ callees listed, the docstring appended. It introduces no vocabulary the source
126
126
  did not already have — which is exactly why retrieval cannot reach a concept
127
127
  nobody wrote down.
128
128
 
129
- The agent already reading the index can supply those words:
129
+ **First, the documentation you already wrote is indexed.** Fourteen of the
130
+ fifteen supported languages put documentation immediately above a declaration
131
+ — JSDoc, Javadoc, KDoc, rustdoc, Go doc comments, XML doc comments, PHPDoc —
132
+ and a unit's span begins at the declaration, so all of it used to sit outside
133
+ the index. The same sentence reached thirteen searchable words as a Python
134
+ docstring and two as a JavaScript comment. Now both reach thirteen. Commented-
135
+ out code, separator rules and licence headers are deliberately left out.
136
+
137
+ **Where there is none, the agent can write it:**
130
138
 
131
139
  ```bash
132
140
  rag-your-code describe status # coverage, and what is pending
@@ -138,23 +146,73 @@ rag-your-code index . # apply it
138
146
  or, in the protocol, `describe_pending` and `describe_put` — which take effect
139
147
  in the same session, with no refresh.
140
148
 
149
+ **And you can move it into the code**, where it needs no bookkeeping at all:
150
+
151
+ ```bash
152
+ rag-your-code describe promote | git apply # review it first
153
+ ```
154
+
155
+ That emits a unified diff adding a doc comment in each language's own
156
+ convention, for declarations that have none. The tool still never writes your
157
+ source. Only the half meant for a reader is promoted, so a bilingual
158
+ description leaves its second language in the store where retrieval still uses
159
+ it — measured, promoting all 68 on this repository discarded no description
160
+ and left Chinese retrieval unchanged.
161
+
141
162
  ### Measured on this repository
142
163
 
143
- This project describes its own implementation: all 120 units under `src/`
144
- carry an agent-written bilingual description, committed to the repo. Ten
145
- natural-language questions about the codebase, before and after:
164
+ This project describes its own implementation: every unit under `src/` carries
165
+ an agent-written bilingual description, committed to the repo, and 68 of them
166
+ have been promoted into the source as doc comments.
146
167
 
147
- | | before | after |
148
- |---|---|---|
149
- | top result in the expected file | 2 / 8 | **6 / 8** |
150
- | Chinese-language queries | 0 / 4 | **3 / 4** |
151
- | queries with **no shared word at all** (pure fallback) | 4 | **0** |
168
+ Seventy natural-language questions about this codebase, in English and
169
+ Chinese, each listing every unit that genuinely answers it
170
+ ([`benchmarks/repo_queries.json`](benchmarks/repo_queries.json)):
152
171
 
153
- Two still miss, and both are worth stating. One query says `catastrophic
154
- backtracking` where the description says `backtracks catastrophically`: there
155
- is no stemming, so those share no word — exactly the limit documented above.
156
- The other returned a unit that answers the question from a different file than
157
- predicted, so the expectation was wrong rather than the retrieval.
172
+ | | generated descriptions | agent-written |
173
+ |---|---|---|
174
+ | hit@1 | 0.271 | **0.500** |
175
+ | hit@3 | 0.486 | **0.800** |
176
+ | MRR | 0.367 | **0.631** |
177
+ | answered with no shared word at all | 12.9% | **0%** |
178
+
179
+ Roughly double the first-place accuracy. Fourteen questions still fail, which
180
+ is what makes the set usable for measuring the next change;
181
+ `tests/test_repo_queries.py` asserts that some question always does, and that
182
+ the written column beats the generated one.
183
+
184
+ One failure is worth naming: a query saying `catastrophic backtracking` does
185
+ not reach a description saying `backtracks catastrophically`. There is no
186
+ stemming — exactly the limit documented above.
187
+
188
+ ### Measured on a repository nobody here wrote
189
+
190
+ The table above is the warmest case this project supports: its own code, its
191
+ own descriptions, and questions written by the same party. It cannot say what
192
+ a first-time user gets. So there is a second ruler — thirty-five questions
193
+ about [cc-enforcer](https://github.com/skymanbp/cc-enforcer), 1153 units, no
194
+ descriptions at all, each question phrased in a user's words rather than in
195
+ the words of the docstring that answers it
196
+ ([`benchmarks/cold_queries.json`](benchmarks/cold_queries.json)):
197
+
198
+ | | before 0.6.0 | now |
199
+ |---|---|---|
200
+ | hit@1 | 0.086 | **0.257** |
201
+ | hit@3 | 0.229 | **0.400** |
202
+ | MRR | 0.157 | **0.314** |
203
+
204
+ Three times the first-place accuracy, and the same change moved both other
205
+ rulers in the same direction. What it fixed was ranking: scoring used to be
206
+ the fraction of query words a unit contained, so `the` counted for as much as
207
+ `daemon`, and nothing corrected for size — the single largest declaration in
208
+ that repository came back in the top three for four questions out of six. It
209
+ is now BM25 over weighted fields, where a word's worth comes from how rare it
210
+ is in *your* corpus and a word in a declaration's name outweighs the same word
211
+ buried in a body.
212
+
213
+ Twenty-one of the thirty-five still fail, and the largest remaining cause is
214
+ named in [docs/TESTING.md](docs/TESTING.md): a test declaration often outranks
215
+ the code it tests, because it repeats that code's vocabulary and adds its own.
158
216
 
159
217
  **What this is:** it moves the semantic work from query time to index time.
160
218
  Matching stays lexical. It is LLM-authored keyword expansion, and its reach is
@@ -203,7 +261,7 @@ Directional local measurements, not service levels; the archived run is
203
261
  **Suite:** Python 3.10 – 3.13 on Linux and Windows, plus a job that installs
204
262
  the built wheel into a clean environment and runs every command the
205
263
  documentation prescribes, and another that runs the skill's own install line
206
- verbatim. 208 tests as of 0.4.2 — the count is version-stamped rather than
264
+ verbatim. 248 tests as of 0.5.0 — the count is version-stamped rather than
207
265
  maintained, because a bare figure in a living document is a claim that rots;
208
266
  per-release counts are in [CHANGELOG.md](CHANGELOG.md).
209
267
 
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "rag-your-code"
9
- version = "0.4.2"
9
+ version = "0.6.0"
10
10
  description = "A local, explainable RAG index for codebases and coding agents"
11
11
  readme = "README.md"
12
12
  requires-python = ">=3.10"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rag-your-code
3
- Version: 0.4.2
3
+ Version: 0.6.0
4
4
  Summary: A local, explainable RAG index for codebases and coding agents
5
5
  Author: rag-your-code contributors
6
6
  License-Expression: MIT
@@ -153,7 +153,15 @@ callees listed, the docstring appended. It introduces no vocabulary the source
153
153
  did not already have — which is exactly why retrieval cannot reach a concept
154
154
  nobody wrote down.
155
155
 
156
- The agent already reading the index can supply those words:
156
+ **First, the documentation you already wrote is indexed.** Fourteen of the
157
+ fifteen supported languages put documentation immediately above a declaration
158
+ — JSDoc, Javadoc, KDoc, rustdoc, Go doc comments, XML doc comments, PHPDoc —
159
+ and a unit's span begins at the declaration, so all of it used to sit outside
160
+ the index. The same sentence reached thirteen searchable words as a Python
161
+ docstring and two as a JavaScript comment. Now both reach thirteen. Commented-
162
+ out code, separator rules and licence headers are deliberately left out.
163
+
164
+ **Where there is none, the agent can write it:**
157
165
 
158
166
  ```bash
159
167
  rag-your-code describe status # coverage, and what is pending
@@ -165,23 +173,73 @@ rag-your-code index . # apply it
165
173
  or, in the protocol, `describe_pending` and `describe_put` — which take effect
166
174
  in the same session, with no refresh.
167
175
 
176
+ **And you can move it into the code**, where it needs no bookkeeping at all:
177
+
178
+ ```bash
179
+ rag-your-code describe promote | git apply # review it first
180
+ ```
181
+
182
+ That emits a unified diff adding a doc comment in each language's own
183
+ convention, for declarations that have none. The tool still never writes your
184
+ source. Only the half meant for a reader is promoted, so a bilingual
185
+ description leaves its second language in the store where retrieval still uses
186
+ it — measured, promoting all 68 on this repository discarded no description
187
+ and left Chinese retrieval unchanged.
188
+
168
189
  ### Measured on this repository
169
190
 
170
- This project describes its own implementation: all 120 units under `src/`
171
- carry an agent-written bilingual description, committed to the repo. Ten
172
- natural-language questions about the codebase, before and after:
191
+ This project describes its own implementation: every unit under `src/` carries
192
+ an agent-written bilingual description, committed to the repo, and 68 of them
193
+ have been promoted into the source as doc comments.
173
194
 
174
- | | before | after |
175
- |---|---|---|
176
- | top result in the expected file | 2 / 8 | **6 / 8** |
177
- | Chinese-language queries | 0 / 4 | **3 / 4** |
178
- | queries with **no shared word at all** (pure fallback) | 4 | **0** |
195
+ Seventy natural-language questions about this codebase, in English and
196
+ Chinese, each listing every unit that genuinely answers it
197
+ ([`benchmarks/repo_queries.json`](benchmarks/repo_queries.json)):
179
198
 
180
- Two still miss, and both are worth stating. One query says `catastrophic
181
- backtracking` where the description says `backtracks catastrophically`: there
182
- is no stemming, so those share no word — exactly the limit documented above.
183
- The other returned a unit that answers the question from a different file than
184
- predicted, so the expectation was wrong rather than the retrieval.
199
+ | | generated descriptions | agent-written |
200
+ |---|---|---|
201
+ | hit@1 | 0.271 | **0.500** |
202
+ | hit@3 | 0.486 | **0.800** |
203
+ | MRR | 0.367 | **0.631** |
204
+ | answered with no shared word at all | 12.9% | **0%** |
205
+
206
+ Roughly double the first-place accuracy. Fourteen questions still fail, which
207
+ is what makes the set usable for measuring the next change;
208
+ `tests/test_repo_queries.py` asserts that some question always does, and that
209
+ the written column beats the generated one.
210
+
211
+ One failure is worth naming: a query saying `catastrophic backtracking` does
212
+ not reach a description saying `backtracks catastrophically`. There is no
213
+ stemming — exactly the limit documented above.
214
+
215
+ ### Measured on a repository nobody here wrote
216
+
217
+ The table above is the warmest case this project supports: its own code, its
218
+ own descriptions, and questions written by the same party. It cannot say what
219
+ a first-time user gets. So there is a second ruler — thirty-five questions
220
+ about [cc-enforcer](https://github.com/skymanbp/cc-enforcer), 1153 units, no
221
+ descriptions at all, each question phrased in a user's words rather than in
222
+ the words of the docstring that answers it
223
+ ([`benchmarks/cold_queries.json`](benchmarks/cold_queries.json)):
224
+
225
+ | | before 0.6.0 | now |
226
+ |---|---|---|
227
+ | hit@1 | 0.086 | **0.257** |
228
+ | hit@3 | 0.229 | **0.400** |
229
+ | MRR | 0.157 | **0.314** |
230
+
231
+ Three times the first-place accuracy, and the same change moved both other
232
+ rulers in the same direction. What it fixed was ranking: scoring used to be
233
+ the fraction of query words a unit contained, so `the` counted for as much as
234
+ `daemon`, and nothing corrected for size — the single largest declaration in
235
+ that repository came back in the top three for four questions out of six. It
236
+ is now BM25 over weighted fields, where a word's worth comes from how rare it
237
+ is in *your* corpus and a word in a declaration's name outweighs the same word
238
+ buried in a body.
239
+
240
+ Twenty-one of the thirty-five still fail, and the largest remaining cause is
241
+ named in [docs/TESTING.md](docs/TESTING.md): a test declaration often outranks
242
+ the code it tests, because it repeats that code's vocabulary and adds its own.
185
243
 
186
244
  **What this is:** it moves the semantic work from query time to index time.
187
245
  Matching stays lexical. It is LLM-authored keyword expansion, and its reach is
@@ -230,7 +288,7 @@ Directional local measurements, not service levels; the archived run is
230
288
  **Suite:** Python 3.10 – 3.13 on Linux and Windows, plus a job that installs
231
289
  the built wheel into a clean environment and runs every command the
232
290
  documentation prescribes, and another that runs the skill's own install line
233
- verbatim. 208 tests as of 0.4.2 — the count is version-stamped rather than
291
+ verbatim. 248 tests as of 0.5.0 — the count is version-stamped rather than
234
292
  maintained, because a bare figure in a living document is a claim that rots;
235
293
  per-release counts are in [CHANGELOG.md](CHANGELOG.md).
236
294
 
@@ -13,6 +13,7 @@ src/ragyourcode/annotate.py
13
13
  src/ragyourcode/cli.py
14
14
  src/ragyourcode/config.py
15
15
  src/ragyourcode/descriptions.py
16
+ src/ragyourcode/document.py
16
17
  src/ragyourcode/embeddings.py
17
18
  src/ragyourcode/graph.py
18
19
  src/ragyourcode/indexer.py
@@ -24,6 +25,8 @@ tests/test_agent_protocol.py
24
25
  tests/test_agentic.py
25
26
  tests/test_config.py
26
27
  tests/test_descriptions.py
28
+ tests/test_doc_comments.py
29
+ tests/test_document.py
27
30
  tests/test_e2e_cli.py
28
31
  tests/test_golden.py
29
32
  tests/test_graph_incremental.py
@@ -33,5 +36,7 @@ tests/test_metadata.py
33
36
  tests/test_multilanguage.py
34
37
  tests/test_parser_edges.py
35
38
  tests/test_ragyourcode.py
39
+ tests/test_ranking.py
40
+ tests/test_repo_queries.py
36
41
  tests/test_resilience.py
37
42
  tests/test_retrieval_correctness.py
@@ -3,4 +3,4 @@
3
3
  from .models import CodeUnit, SearchResult
4
4
 
5
5
  __all__ = ["CodeUnit", "SearchResult"]
6
- __version__ = "0.4.2"
6
+ __version__ = "0.6.0"
@@ -8,10 +8,17 @@ from .search import DEFAULT_VECTOR_WEIGHT, SearchIndex, search
8
8
 
9
9
 
10
10
  def _result_ids(results: list[SearchResult]) -> set[str]:
11
+ """Collects the unit identifiers out of a list of search results, so two
12
+ result sets can be compared for overlap or novelty. Used to decide
13
+ whether a second retrieval round actually surfaced anything new.
14
+ """
11
15
  return {result.unit.id for result in results}
12
16
 
13
17
 
14
18
  def _serialize(results: list[SearchResult]) -> list[dict]:
19
+ """Converts search results into plain JSON-ready dictionaries for the agent
20
+ protocol reply.
21
+ """
15
22
  return [result.to_dict() for result in results]
16
23
 
17
24
 
@@ -7,11 +7,22 @@ import re
7
7
 
8
8
 
9
9
  def _humanize(name: str) -> str:
10
+ """Turns a programmer identifier into ordinary words: splits camelCase
11
+ apart, replaces underscores with spaces, lowercases the result. Empty
12
+ input becomes a placeholder rather than an empty string.
13
+ """
10
14
  words = re.sub(r"([a-z0-9])([A-Z])", r"\1 \2", name).replace("_", " ").split()
11
15
  return " ".join(words).strip().lower() or "anonymous unit"
12
16
 
13
17
 
14
18
  def describe_python(node: ast.AST, source: str, calls: list[str], imports: list[str]) -> str:
19
+ """Builds a readable sentence about a Python function or class without
20
+ using a language model: the humanised name, the arguments it accepts,
21
+ the functions it calls, the modules it uses, and the docstring appended
22
+ verbatim as stated intent. Because it only rearranges words already in
23
+ the source, it adds no vocabulary the code did not have, which is why
24
+ retrieval cannot reach a concept nobody wrote down.
25
+ """
15
26
  name = getattr(node, "name", "anonymous")
16
27
  kind = "method" if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)) else "class"
17
28
  args = []