Skip to content

CGR-38: ARB result with no tuning on ARB samples (tests edges, file documents, anchor fusion) - #209

Merged
taylorg009 merged 10 commits into
mainfrom
cgr-38-clean-arb
Oct 19, 2026
Merged

taylorg009 merged 10 commits into
mainfrom
cgr-38-clean-arb

Conversation

@taylorg009

Copy link
Copy Markdown
Collaborator

CGR-38: a CGraph result on Agent Retrieval Bench (ARB) with no tuning on ARB samples.

Protocol

  • Declared split before any change (score.py DEV_REPOS, bee900e). Dev = every gin, caddy and clap sample (111). Held-out = the other 234 samples from 22 repos.
  • External dev set (bench/arb/extdev/): 229 code2test and 187 edit2ripple samples, mined with ARB's own miners from 10 repos ARB never used. The ARB dev split has no comment2context and only 19 code2test samples, so it could not drive tuning alone.
  • Held-out samples never inspected individually. Aggregates were read for: the bin-v0.9.5 baseline, this branch build, and (still to do) the released binary.

Changes

  1. tests edges from a test file to the source file its name pairs with. In-directory always. Package-unique or mirrored pairing only under a test root. Generic stems pair in-directory only.
  2. File body documents. A file node's BM25 document = the text outside any symbol, plus its path.
  3. Test counterparts in context. A seed's tests are reached at depth 1 (none when max_depth is 0).
  4. Harness: anchor fusion. The per-file anchor lists are fused among themselves and vote once.

OpenSpec: test-subjects-and-file-documents (validates --strict). Index key logic-26.

Results (branch build; to be re-run on the released binary)

R@20 MRR BCY@8k
Held-out 234, RepoMap 0.5402 0.1785 0.3363
Held-out 234, bin-v0.9.5 0.5164 0.2076 0.3184
Held-out 234, branch 0.5628 0.2076 0.3167
All 345, RepoMap 0.6311 0.2156 0.3846
All 345, branch 0.6692 0.2951 0.4395

Against RepoMap on held-out:

  • Ahead: R@20 by 0.0226 and MRR by 0.0291, both outside the noise floor.
  • Behind: BCY@8k by 0.0196.
  • trace2code regressed: MRR 0.3551 to 0.3094 against bin-v0.9.5.

Full tables are in bench/arb/RESULTS.md.

Verification

  • 102/102 ctest pass. The new tests fail without their change (daemon_ops_test returns 130 when the counterpart block is reverted).
  • An ASan build ran the full external dev set (416 samples) with 0 reports and rankings identical to the release build.
  • A non-author review found one blocking bug, fixed in 4a93da7: a test outside a test root was paired across packages.
  • tests pairs were checked by hand on the gin (27), clap (12) and caddy (67) snapshots.

🤖 Generated with Claude Code

taylorg009 and others added 10 commits October 17, 2026 00:22
Retrieval work for CGR-38 is developed on gin, caddy and clap only (the repos
CGR-25 was tuned on) and reported on the 234 held-out samples from the other
22 repos. score.py --split dev|heldout filters before scoring, so BCY is packed
on the same subset. Reproduces the held-out bin-v0.9.1 numbers
(R@20 0.5164, MRR 0.2145, BCY@8k 0.3198; RepoMap 0.5402 / 0.1785 / 0.3363).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Calls from a test reach the code under test only when call resolution is
unambiguous, so most test files were islands: context and impact from a source
file never reached its tests. A build pass (one-shot and incremental) now adds
an inferred `tests` edge from each test file to the source file its name pairs
with, reusing is_test_source_path and co_change's stem pairing (moved next to it).
A stem several source files share pairs only by same directory, the mirrored
directory under a test root, or a unique match; otherwise no edge.

common_source_root() replaces the inline root derivation in contracts.cpp.
Index version key -> logic-26 (graph shape changed).

ARB dev split (gin/caddy/clap, 111): R@20 0.8859 -> 0.8994, MRR 0.4199 -> 0.4721,
BCY@8k 0.6682 -> 0.6907 vs bin-v0.9.5. Held-out not scored.
bench: cgraph_eval.py --split, and per-task details files always exist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On clap the unique-stem fallback paired five tests/testsuite/main.rs files with
examples/typed-derive/main.rs, tests/builder/utils.rs with clap_complete's
utils.rs and a nushell test with an example. Beyond its own directory a test
now pairs only inside its package (what precedes its test root), generic names
(main, mod, lib, index, utils...) pair only in-directory, and example, doc and
bench files are never subjects. clap 21 -> 13 tests edges (all correct by
inspection), gin unchanged at 27; ARB dev split unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A file node's span is its first line, so text no symbol encloses (top-level
statements, a test file's anonymous test(...) blocks, data modules) was in no
BM25 document, and neither was the file's path. The file node's document is now
the lines no other node's span covers, plus its path terms; symbol documents
are unchanged and nothing is counted twice.

External dev set (CGR-38; 10 repos outside ARB, code2test + edit2ripple):
code2test R@20 0.7031 -> 0.7460, BCY@8k 0.5138 -> 0.5573 over the tests-edge
build. ARB dev split R@20 0.8994 -> 0.8979, MRR 0.4721 -> 0.4774.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tests edge hangs off the file node, a hop past a symbol seed, and test
files carry little centrality, so context ranked every file the seed's file
imports above the seed's own tests. Counterparts by a tests edge (a source
seed's tests, or a test seed's subject) now enter at depth 1, the footing of
the seed's file, in fixed and adaptive gathering alike.

External dev set: R@20 0.7256 -> 0.7277, BCY@8k 0.5193 -> 0.5229.
ARB dev split: MRR 0.4774 -> 0.4801, BCY@8k 0.6892 -> 0.6982.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each anchor op list (one per implementation file or quoted path) had its own
RRF vote, so correlated anchors (build-tag twins, sibling locale files) outvoted
the query's own lists: zod's parity.test.ts was rank 1 in both text lists and
fused to 43. The anchor lists are now fused among themselves and vote once
(cgraph_eval.fuse, shared with ablation.py). ablation.py also tolerates a split
run with no sample of a task.

External dev set: R@20 0.7277 -> 0.7418, MRR 0.3792 -> 0.4101, BCY@8k 0.5229 ->
0.5517. ARB dev split: R@20 0.8979 -> 0.8934, MRR 0.4801 -> 0.4797, BCY flat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review found the package scope empty for a test outside a test root, so the
unique-stem step matched anywhere: caddy got reverseproxy/headers_test.go ->
headers/headers.go and integration/handler_test.go -> push/handler.go, which
impact and context then served. A test outside a test root now pairs only
beside its subject; stems exactly test/tests count as tests (Rust tests.rs
modules are never subjects); context's counterpart rule honours max_depth 0.
Tests: cross-directory and tests.rs cases, max_depth 0, and incremental vs
one-shot parity on a tree with a test file. Dev split and external dev set
scores unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Specs for the tests edge pass, file body documents and context's depth-1 test
counterparts (CGR-38). openspec validate --strict passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add bench/arb/extdev/: the 10-repo external dev set (v2_code2test 229
samples, v2_edit2ripple 187) mined with ARB's own miners, its four builder
scripts, and a README with the pipeline, funnel tables, audit substitute,
deviations and baseline scores. The chunked corpus and snapshot caches are
regenerable (ARB build-corpus plus bench/arb/snapshots.py) and not committed.
crawl_repo.sh now takes its work dir from ARB_WORK.

score.py gains --tasks (default all four) so the scorer works on a dataset
with only some tasks. Default output is byte-identical to before; on extdev
it reproduces the numbers of the earlier task-trimmed copy exactly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

PR brief: 0 agent commits · run the full suite

Warning

Run the full suite. The graph cannot vouch for this diff, so every test file is selected. Nothing is skipped; this is the safe default, not a failure.

6 files have no graph node (config, asset, or unextracted).

If these files cannot change which tests should run, add a pattern for them to ignore. If they feed tests (fixtures, data), this outcome is correct.

bench/arb/extdev/data/benchmark/v2_code2test    ████████████████████████  2
bench/arb/extdev/data/benchmark/v2_edit2ripple  ████████████████████████  2
bench/arb/extdev                                ████████████  1
bench/arb/extdev/scripts                        ████████████  1
All 6 unmapped files
bench/arb/extdev/.gitignore
bench/arb/extdev/data/benchmark/v2_code2test/manifest.json
bench/arb/extdev/data/benchmark/v2_code2test/samples.jsonl
bench/arb/extdev/data/benchmark/v2_edit2ripple/manifest.json
bench/arb/extdev/data/benchmark/v2_edit2ripple/samples.jsonl
bench/arb/extdev/scripts/crawl_repo.sh

Computed at c374a8d against base 54da1b0.

Summary PR #209
Intent no checkpoints on this branch (10 commits)

What each commit did

Commit Intent Files Reaches Ran before push
bee900e bench(arb): declare the CGR-38 dev/held-out split and score… no checkpoint 1 file
e79ec10 feat(graph): tests edges from a test file to the source fil… no checkpoint 11 files
25933c2 fix(graph): scope cross-directory test pairing to the test'… no checkpoint 4 files
968b654 feat(search): a file's body document holds its unenclosed t… no checkpoint 2 files
a3f130d feat(context): a seed's tests are reached at depth 1 no checkpoint 2 files
053aba3 bench(arb): anchors vote once in the fused ranking no checkpoint 2 files
4a93da7 fix(graph): a test outside any test root pairs only in its … no checkpoint 6 files
67f994c docs(openspec): test-subjects-and-file-documents change no checkpoint 4 files
87095cf bench(arb): CGR-38 results section (branch build, pending r… no checkpoint 1 file
c374a8d bench(arb): commit the external dev set and score.py --tasks no checkpoint 11 files

Claims checked

no checkpoint on this branch makes a claim the graph can check

blastline 0.13.0. Selection is advisory unless your workflow gates on it. How selection works. Intent: 0 of 10 commits. Not checked: symbol changes: no --change-context given.

@taylorg009
taylorg009 marked this pull request as ready for review October 19, 2026 06:42

@tgod009 tgod009 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-author review: one blocking finding (cross-package test pairing) fixed in 4a93da7 and re-verified on caddy/gin/clap; 102/102 ctest, ASan extdev clean, CI green.

@taylorg009
taylorg009 merged commit 7bb2413 into main Oct 19, 2026
22 of 23 checks passed
taylorg009 added a commit that referenced this pull request Oct 19, 2026
Launcher release.json (four assets, SHA-256 from the release, checked against
the downloaded files), plugin version, npm package.json, server.json, the
Homebrew formula and the README install steps, written by
scripts/pin_launcher_release.py bin-v0.9.6 plus the README bump.
bin-v0.9.6 is main 7bb2413: tests edges, file body documents, depth-1 test
counterparts in context, and the CGR-38 benchmark protocol (#209).

bench/arb/RESULTS.md: the CGR-38 section now reports the released binary.
Held-out look 3 on bin-v0.9.6 reproduced the branch build exactly
(R@20 0.5628, MRR 0.2076, BCY@8k 0.3167; all 345: 0.6692 / 0.2951 / 0.4395).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants