Commit 13b9e5b
Close A@5 = A@1 collapse in retrieve_brief with lexical fallback
Pre-fix, the brief forced target_files[:4] then the fit_agent_brief
budget loop aggressively popped target_files down to 1 to fit the 220-
token small-model budget. Together those meant Artifact@5 ≡ Artifact@1
by construction — state-trace had at most one file to rank against a
golden path.
Three changes:
1. Bumped `target_files[:4]` to `[:5]` so A@5 even has room to work.
2. Cold-start lexical fallback in build_agent_brief: when target_files
has fewer than 5 entries, mine file-path candidates out of the
query + top-scored node content + `issue_text` / `hints_text`
metadata, filtered through a conservative `_looks_like_file_path`
gate (dir separator + real extension, rejects "is/was"-style
garbage).
3. URL-aware extraction in `_extract_lexical_file_candidates`. Regular
ingestion's `extract_file_paths` rejects http(s) URLs (right call
for edit-loop observations, wrong call for cold-start localization
where SWE-bench-Verified issue texts embed golden paths inside
github.com/.../blob/... URLs far more often than bare). The
fallback extracts repo-relative paths from github / gitlab blob
URLs alongside normal path tokens.
4. Raised the fit_agent_brief target_files floor from 1 to 3 so the
budget loop can't strip A@5 candidates back down to a single file.
Effect on n=50 smoke: state_trace A@1 0.120 → 0.160, A@5 0.120 → 0.240,
now beats BM25 on A@1 and closes most of the A@5 gap (bm25 0.260).
Full n=500 re-run in progress; README will be updated when it lands.
15 tests passing (was 14); added regression test exercising the
lexical fallback end-to-end with both a graph file node and
issue_text-derived candidates.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e3ae59e commit 13b9e5b
2 files changed
Lines changed: 140 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
959 | 961 | | |
960 | 962 | | |
961 | 963 | | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
962 | 999 | | |
963 | 1000 | | |
964 | 1001 | | |
| |||
1032 | 1069 | | |
1033 | 1070 | | |
1034 | 1071 | | |
1035 | | - | |
| 1072 | + | |
1036 | 1073 | | |
1037 | 1074 | | |
1038 | 1075 | | |
| |||
1122 | 1159 | | |
1123 | 1160 | | |
1124 | 1161 | | |
1125 | | - | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
1126 | 1165 | | |
1127 | 1166 | | |
1128 | 1167 | | |
| |||
1267 | 1306 | | |
1268 | 1307 | | |
1269 | 1308 | | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
1270 | 1362 | | |
1271 | 1363 | | |
1272 | 1364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
329 | 375 | | |
330 | 376 | | |
331 | 377 | | |
| |||
0 commit comments