Skip to content

fix(explore): the named symbols take turns in the dynamic-dispatch links list - #2751

Merged
colbymchenry merged 1 commit into
mainfrom
claude/explore-dispatch-links-interleave
Oct 21, 2026
Merged

colbymchenry merged 1 commit into
mainfrom
claude/explore-dispatch-links-interleave

Conversation

@colbymchenry

Copy link
Copy Markdown
Owner

Summary

Second follow-up from #2748, found while validating #2750. codegraph_explore's Dynamic-dispatch links among your symbols list holds 6 lines. Links of the same rank were taken in edge order, so one named symbol's long fan-out could fill the list before another named symbol's first link.

prometheus's refresh.Discovery.refresh hands its func field to 28 discovery packages. In refresh.Discovery.refresh hetzner.refresher.refresh hcloudDiscovery.refresh, those 28 links filled all six lines, and refresher.refresh → robotDiscovery.refresh was dropped at the same rank.

Main (f5dfa21):

- Discovery.refresh → Discovery.refresh   [dynamic: func field `Discovery.refreshf` (set from `Options.RefreshF`) @discovery/uyuni/uyuni.go:251]
- Discovery.refresh → Discovery.refresh   [… @discovery/moby/dockerswarm.go:187]
- Discovery.refresh → Discovery.refresh   [… @discovery/dns/dns.go:159]
- Discovery.refresh → refresher.refresh   [… @discovery/openstack/openstack.go:164]
- Discovery.refresh → Discovery.refresh   [… @discovery/oci/oci.go:298]
- Discovery.refresh → LightsailDiscovery.refresh   [… @discovery/aws/lightsail.go:168]

This PR:

- Discovery.refresh → Discovery.refresh   [dynamic: func field `Discovery.refreshf` (set from `Options.RefreshF`) @discovery/uyuni/uyuni.go:251]
- refresher.refresh → robotDiscovery.refresh   [dynamic: interface → impl @discovery/hetzner/robot.go:73]
- Discovery.refresh → Discovery.refresh   [… @discovery/moby/dockerswarm.go:187]
- …

Change (collectSynthLinks in src/mcp/tools.ts)

  • Each link gets a turn: how many links of its rank the named symbol it hangs from already has.
  • Links sort as before (test/example files last, then weight), then by turn, then by edge order. Links of the same rank alternate between the named symbols.
  • Rank still comes first, so the fix(explore): every dynamic-dispatch link gets its own line, the ones the query names first #2748 rules hold: an implementation the query names still precedes one it doesn't, and links into tests and examples still come last.

Validation

All runs are on main f5dfa21. One index per repo; the arms differ only in dist/mcp/tools.js.

Tests: __tests__/explore-synth-link-endpoints.test.ts

Sweep: gin and prometheus, main → this PR

Query shapes as in #2748 (A X I, B/C P X I C, R random controls), plus a new shape:

  • W: two interface methods with 2+ implementations each, named together, totalling more than six links.
repo · shape queries Flow text identical outside the section differs distinct left-hand symbols listed, main → PR queries with fewer
gin W 150 18 0 231 → 292 0
prometheus W 150 23 0 234 → 297 0
gin A / B / C / R 52 / 18 / 7 / 150 52 / 13 / 7 / 149 0 52/18/7/51 → 52/23/7/52 0
prometheus A / B / C / R 150 / 150 / 74 / 150 112 / 96 / 48 / 145 0 153/163/109/70 → 199/223/124/73 3 (B)
  • Nothing outside the links section changes. The list keeps its length, so the source sections are byte-identical.

  • The "fewer" column. The left-hand symbol is a proxy for the named symbol a link hangs from; the anchor can be on the right (SeriesSet.Err → lazyGenericSeriesSet.Err hangs from the named lazyGenericSeriesSet.Err). In the 3 prometheus B queries with fewer left-hand symbols:

    • main listed four of one named implementation's links, each from a different interface;
    • this PR gives those slots to the other named symbols, one line each.

    With more named anchors than slots, the last anchor in query order can still miss out.

  • Prometheus A/B/C also change. There the named implementation hangs other links (other interfaces it satisfies), and they now take turns with the interface's fan-out.

    • Appender.Append matches two interfaces, storage.Appender and chunkenc.Appender. On main, chunkenc's implementations filled the list for a scrapeLoop query, which uses storage's. Now storage's timestampTracker and timeLimitAppender and the named notReadyAppender's second interface, LimitedAppenderV1, appear.
  • More lines whose site is a test file in prometheus A/B. 91 of the 103 added such lines come from queries that name a test double themselves, whose own links now get a turn. The rest are reshuffles inside the last tier, or a link registered in a test file with a production target. Links into tests through an unnamed end still sort after every other link.

Cost

Flow builder time, fix/main: median 0.99 (gin) and 0.96 (prometheus), with p95 1.13 / 1.09.

Suites

Full suite on this commit over main f5dfa21, on Windows, with the kernel built, CODEGRAPH_KERNEL_EXPECT=1 and --maxWorkers=4 --minWorkers=1:

  • 694 files, 0 failed;
  • 8,304 tests: 8,222 passed, 0 failed, 82 skipped;
  • 19 kernel suites ran, 306 tests, all passed.

🤖 Generated with Claude Code

…nks list

Links of the same rank were listed in edge order, so one named symbol's
long fan-out could fill the 6-line list before another named symbol's
first link. prometheus's `refresh.Discovery.refresh` hands its func
field to 28 discovery packages, and in `refresh.Discovery.refresh
hetzner.refresher.refresh hcloudDiscovery.refresh` those links filled
the list before `refresher.refresh` → `robotDiscovery.refresh`.

Each link now has a turn: how many links of its rank the named symbol
it hangs from already has. Links sort by rank as before, then by turn,
then by edge order, so links of the same rank alternate between the
named symbols. A token that names two interfaces gets both: prometheus's
`Appender.Append` matches storage.Appender and chunkenc.Appender, and
storage's implementations no longer wait behind six of chunkenc's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@colbymchenry
colbymchenry merged commit bbf987e into main Oct 21, 2026
@colbymchenry
colbymchenry deleted the claude/explore-dispatch-links-interleave branch October 21, 2026 15:07
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.

1 participant