Skip to content

perf(ai): Compare resolver with and without lens on 58 gold answers #5821

Open

Description

@devops-cli-service

Split from #4831.

Problem or Motivation

The work runs the same arm protocol for the question resolver on the 58 gold answers, with the lens section and without it, and records the result.

Why deferred

The issue names no file and no revision that holds the 58 gold answers. The question resolver is not the group-analysis subsystem, so this comparison has its own inputs and its own run cost. The question resolver work of #4808 and the lens section of #4830 come first.

Dependencies

Acceptance Criteria

  • The change names the file that holds the 58 gold answers and the revision that it reads.
  • The run store holds the two resolver arms, each with k = 3.
  • docs/SELF_IMPROVEMENT.md records the floor, the delta and the keep-or-delete decision for the question resolver.
  • The pull request deletes the lens section from the question resolver when it loses.

Proposed design

Problem statement

The question resolver has a lens section that may add token cost without improving accuracy. This issue compares the resolver with and without the lens on 58 gold answers. It records the floor, the delta and the keep-or-delete decision in docs/SELF_IMPROVEMENT.md. It deletes the lens section when the without-lens arm wins.

Acceptance criteria

Requirement: Pinned gold-answer fixture

The resolver comparison MUST read the 58 gold answers from tests/fixtures/roadmap_eval/resolve/gold_answers.json and MUST read the repository at each case's base_commit.

Scenario: A case with no base commit is refused

  • WHEN The comparison runs a gold-answer case whose entry has no base_commit.
  • THEN The command exits non-zero and names the case and the missing base_commit.

Requirement: Two resolver arms at k = 3

The comparison MUST record both resolver arms, lens on and lens off, at k = 3 in the run store.

Scenario: Six run records hold 58 answers each

  • WHEN The comparison runs with the model stubbed on the 58-case fixture.
  • THEN The run store holds 6 records for mechanism resolve (2 arms x 3 runs), and each record's results holds 58 rows with the arm id, the lens flag, pass/fail and the token cost.

Requirement: Decision record in SELF_IMPROVEMENT

The comparison MUST write the floor, the delta and the keep-or-delete decision to the resolver section of docs/SELF_IMPROVEMENT.md.

Scenario: A completed comparison writes the resolver section

  • WHEN The comparison runs with a stubbed model and a temporary docs path.
  • THEN The written section holds the floor, the delta and the decision that the run-store record holds.

Requirement: Lens deletion on loss

The change MUST delete the lens section from the question resolver when the without-lens arm wins.

Scenario: A delete decision leaves no lens section

  • WHEN The recorded decision is delete.
  • THEN The question resolver's prompt template holds no lens section and the lens toggle is removed.

Existing Tool Considered

No alternatives check has run (alternatives is null). pydantic-evals 2.59.0 is the open, maintained library. It is locked at uv.lock:3619 and used by src/devops_cli/roadmap/duplicate_eval.py:242 and src/devops_cli/roadmap/stage/stage_verify_eval.py:272. It covers a Dataset of cases, a task, an evaluator, repeated runs and a report. It lacks the project's run-store schema (RunRecord in src/devops_cli/ai/run_store.py:80), the project's 58 gold-answer file and the resolver's lens toggle. promptfoo was considered and rejected by the project: it needs Node.js and does not know the project's schema (openspec/changes/archive/2026-11-02-3153-the-stage-job-verifies-its-plan/proposal.md:59). The change writes about 150 lines of glue on pydantic-evals. Written cost: about 50 000 tokens and 1-2 days to build, about 2 000 tokens a year to keep, and about 5 000 tokens to fix.

Key questions

  • Which file holds the 58 gold answers, and which revision does the comparison read?: The issue names no file. The comparison adds tests/fixtures/roadmap_eval/resolve/gold_answers.json with 58 cases. Each case holds the question, the gold answer, its verified sources and the base_commit that the resolver reads. The command checks out each case at that commit, as devops roadmap eval stage does. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:500, src/devops_cli/roadmap/intake_duplicate_cases.json:2, tests/fixtures/roadmap_eval/stage/2116-the-scanner-executor-tests-find-the/case.json:6, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:138]
    • Chosen: Add a 58-case file under tests/fixtures/roadmap_eval/resolve, one base_commit per case. It follows the eval-set convention and pins the revision each answer was verified at.
    • Rejected: Reuse the stage golden set. It holds plans and their defects, not answers to questions, and its cases do not match the 58 answers.
    • Rejected: Read the live issue comments and the run store at run time. It is not reproducible offline, and the gold label would change under the run.
  • Which store holds the two resolver arms, and what does each record hold?: The existing run store. devops ai runs records one RunRecord for each run. The comparison writes 6 records (2 arms x 3 runs). Each record has the arm id and the lens flag in setup, the 58 gold-answer ids and the pinned commit in subject, and 58 answer rows (pass/fail and token cost) in results. devops ai runs baseline set and compare then print each arm's range and whether the ranges overlap. (best practice) [sources: src/devops_cli/ai/run_store.py:80, src/devops_cli/ai/run_store.py:90, docs/SELF_IMPROVEMENT.md:851]
    • Chosen: Extend the existing run store. It keeps one store for AI runs, and devops ai runs compare already reads it.
    • Rejected: Add a separate eval store. It duplicates the run store and splits the records from the comparison.
    • Rejected: Keep only the pydantic-evals report. It does not join the run store, so the arms cannot be compared with devops ai runs.
  • What rule decides keep or delete the lens section?: Delete the lens section only when the without-lens arm's accuracy figures overlap the with-lens arm's range (the A/A noise floor) or are better, and its mean token cost is lower. Keep it otherwise. With k = 3 no significance test is run, and the ranges are the evidence. (best practice) [sources: docs/SELF_IMPROVEMENT.md:851, docs/SELF_IMPROVEMENT.md:858, docs/SELF_IMPROVEMENT.md:902]
    • Chosen: Overlap the with-lens range or be better, and lower mean token cost. It is the project's recorded protocol for a prompt change: the guards must overlap the A/A noise floor or be better, and the effects are read beside them.
    • Rejected: Non-inferiority with a 5-point margin and lower cost. No project record states a 5-point margin; the recorded protocol reads the ranges, not a fixed margin.
    • Rejected: Delete on a higher raw pass rate only. It ignores the noise of k = 3 and the token cost.
  • Where does the decision record live?: docs/SELF_IMPROVEMENT.md records the floor, the delta and the keep-or-delete decision for the question resolver. [sources: docs/SELF_IMPROVEMENT.md:826, docs/SELF_IMPROVEMENT.md:851]
  • Which open, maintained tool runs the comparison?: pydantic-evals 2.59.0, already locked and used by the roadmap evals, runs the dataset, the task and the evaluator. The change adds the resolver task and records each run through devops ai runs. promptfoo was considered and rejected by the project because it needs Node.js and does not know the project's schema. (best practice) [sources: pyproject.toml:378, uv.lock:3619, src/devops_cli/roadmap/duplicate_eval.py:242, openspec/changes/archive/2026-11-02-3153-the-stage-job-verifies-its-plan/proposal.md:59, AGENTS.md:9]
    • Chosen: pydantic-evals. It is open, maintained and locked, and the project already scores two roadmap evals with it.
    • Rejected: promptfoo. It needs Node.js and does not know the project's run-store schema or the lens toggle.
    • Rejected: A harness written here. AGENTS.md rule 3 outranks a build when an open library covers the need; the resolver task and evaluator are about 150 lines.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#4830, #4808

Activity

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

    @devops-cli-service
    ContributorAuthor
  3. changed the title [-]perf(ai): compare the question resolver with and without the lens on the 58 gold answers[/-] [+]perf(ai): Compare resolver with and without lens on 58 gold answers[/+] on Nov 15, 2026
  4. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    ContributorAuthor

    The job shortened the title of this item. The summary had 78 characters, and the limit is 60. The type and the scope stay.

    • Before: perf(ai): compare the question resolver with and without the lens on the 58 gold answers
    • After: perf(ai): Compare resolver with and without lens on 58 gold answers
    • Source of the summary: the background model
  5. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    ContributorAuthor

    Refine cannot set this item to Ready at 86358b6 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

  6. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in 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/p2-mediumscope/aisource/agentstatus/newtype/infravalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions