Skip to content

code.symbol and code.grep take at_commit, so lead answers as of a past commit #2222

Done

Description

@zlareb1

Company

ClickHouse

Component

Code index

Use case

A PR-review agent replays reviews of merged PRs to measure what it would have found at merge time. code.test_gate and code.tests_for take at_commit (#2043), so their test lists keep to what the merge commit held. The lead block on code.symbol and code.grep (#2048) has no such bound:

  • changed_by lists PRs merged after the reviewed one, so the replay sees the later fix.
  • tested counts tests from the indexed head, including tests a later fix added.

The client has to filter changed_by by merge date itself, and it cannot filter tested.

Describe the solution you'd like

code.symbol and code.grep take at_commit, with the same validation and meaning as on code.test_gate: a commit the indexed head contains. With it, the lead block answers as of that commit:

  • changed_by keeps the PRs merged at or before it;
  • tested keeps the test files that commit holds, and marks a kept file that changed since with changed_since_at, as code.test_gate does;
  • callers is the head's call graph filtered the same way, and says so.

Describe alternatives you've considered

  • lead: false and separate calls to code.tests_for with at_commit and to code.symbol_history, filtered by merge date on the client. That is the per-call cost lead was added to remove.
  • Filtering changed_by on the client by merged_at. It works for changed_by only.

Where the need comes from

I hit this need myself

Additional context

Follows #2040 (item 2 bounded code.test_gate and code.tests_for; item 4 added lead).

Activity

  1. added
    enhancement
    on Dec 5, 2026
  2. added a commit that references this issue on Dec 5, 2026
    cdb93e8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions