Skip to content

test(ai): compare review eval scores for manual index change #4110

Open

Description

@devops-cli-service

Split from #3916.

Problem: The issue asks for a review eval run before and after on the same cases, and for the scores in the pull request comment. The gold set is not in this repository. The run also needs model calls and is not an offline test. Why deferred: The manual lookup change can use recorded Qdrant data and needs no gold set. Acceptance criteria: - The gold set is available. - The same cases run before and after the change. - The pull request comment gives both scores. - The run records the commit, the model and the case set.

Proposed design

Problem statement

The manual index lookup change in #3916 needs a review eval run before and after on the same cases. The pull request comment must give both scores. The gold set is not in this repository, and the run needs model calls, so the live eval cannot be an offline test. This change adds the offline comparison logic. It rejects mismatched case sets, renders both scores in a pull request comment, and records the commit, model and case set. A person runs the live eval separately.

Acceptance criteria

Requirement: Case-set mismatch rejected

The comparison function SHALL reject two review score records whose case-set identifiers differ.

Scenario: Different case sets

  • WHEN the comparison function receives a before record and an after record with different case_set_id values
  • THEN it raises a ValueError that names both identifiers and returns no score pair

Requirement: Both scores rendered

The comment renderer SHALL include the score before the change, the score after the change, and their difference.

Scenario: Two records with the same case set

  • WHEN the renderer receives two records with the same case_set_id, a before score of 0.5 and an after score of 0.7
  • THEN the rendered text contains before: 0.5, after: 0.7 and difference: +0.2

Requirement: Run record fields

Each eval run record MUST hold the commit hash, the model name and the case-set identifier.

Scenario: Run record written

  • WHEN a run record is created from a commit hash, a model name and a case-set identifier
  • THEN the record has non-empty commit, model and case_set_id fields

Requirement: Missing case-set identifier

The comparison function SHALL stop with an error when a record has no case-set identifier.

Scenario: Missing identifier

  • WHEN a record has an empty case_set_id
  • THEN the function raises a ValueError that names the missing field

Existing Tool Considered

No alternatives check has run. The project already has devops review score to score saved review sessions and devops ai runs compare to compare two arms. The change adds a small comparison function and comment renderer on top of their JSON records. It builds no new eval harness. Building a separate harness would cost about 20k tokens and one working day.

Key questions

  • How does the comparison enforce the same case set before and after the change?: Each record carries a case_set_id that is the content hash of the label file and recall set. The comparison function rejects records whose identifiers differ. (best practice) [sources: src/devops_cli/review/score.py, tests/fixtures/review_labels/labels.json]
    • Chosen: Record a case-set identifier in each run. It detects a mismatch with no person in the loop.
    • Rejected: Trust the operator to use the same cases. Nothing detects an operator error.
  • How does the change render both scores in the pull request comment?: A pure function renders a Markdown table with the before score, the after score and the difference from two score records. (best practice) [sources: src/devops_cli/review/score.py, docs/commands/review.md]
    • Chosen: Add a small renderer for two review score records. It reuses the existing score JSON and keeps the comment format stable.
    • Rejected: Reuse the devops ai runs compare output. That output compares arms, not review score records, so it lacks the review score fields.
  • What fields does a run record hold?: A JSON object with commit, model and case_set_id. (best practice) [sources: docs/SELF_IMPROVEMENT.md]
    • Chosen: Commit, model and case-set identifier. These three fields let a reader reproduce the run and compare the case sets.
    • Rejected: Add the full prompt and tool versions. The issue asks for the commit, the model and the case set only.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/test
    scope/ai
    status/new
    value/medium
    effort/medium
    on Nov 8, 2026
  2. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    ContributorAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/test. The test prefix of the title gives the type.
    • Scope: scope/ai. The (ai) scope of the title gives the scope.
    • Priority: P3-Low. The work is deferred and blocked until the gold set is available.
    • Value: Medium. The comparison gives evidence that a review prompt change does not regress the scores.
    • Effort: Medium. The work needs a gold set, model calls and two runs on the same cases.
    • Related: feat(ai): model-in-the-loop prompt benchmarking #413, which asks for a different change. Both items score review prompts with model calls, but #413 builds the model-in-the-loop benchmark tool and this candidate defers one before-and-after run that needs a gold set.
  3. added
    priority/p3-low
    on Nov 8, 2026
  4. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    ContributorAuthor

    Refine cannot set this item to Ready at 6121d09 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • Where does the gold set for the review eval live, and who can make it available to this repository or to the run? (a person decides)
  5. devops-cli-service commented on Nov 23, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

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

    effort/mediumpriority/p3-lowscope/aisource/agentstatus/newtype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions