Skip to content

feat(roadmap): run stage eval arm B as a live trial #8020

Backlog

Description

@devops-cli-service

Split from #5501.

Problem: If the A/B run adopts B, the live stage Job must run arm B as the App through a #5177 trial. The trial mechanism of #5177 extends to an arm that is not a model. Why deferred: It waits for #5177 and a release, and it cannot run before the code merges. Acceptance criteria: After the release, the stage Job runs arm B as the App through a #5177 trial; its result lines carry the trial name; a comment gives the guard values at each check. The guard uses the first attempt of each item. It stops B when its Wilson upper bound is below the point estimate of A, or when a one-sided Fisher test gives p below 0.1.

Proposed design

Problem statement

The A/B eval run of #5501 compares two arms of the stage job. If the run adopts arm B, the live stage Job must run arm B as the App through a #5177 trial. This item adds the guard and the trial name in the result line, and it runs the trial after the release. The guard reads the first result line of each item in Loki. It stops arm B when the Wilson upper bound of arm B is below the point estimate of arm A. It also stops arm B when a one-sided Fisher test gives p below 0.1. It records each check in a comment on #5501.

Acceptance criteria

Requirement: Wilson bound stops arm B

The eval guard SHALL return stop for arm B when the Wilson upper bound of arm B is below the point estimate of arm A.

Scenario: Arm B has a low Wilson upper bound

  • WHEN the guard reads arm A with 10 successes in 20 first attempts and arm B with 2 successes in 20 first attempts
  • THEN the guard returns stop for arm B and reports the Wilson upper bound of arm B and the point estimate of arm A

Requirement: Fisher test stops arm B

The eval guard SHALL return stop for arm B when a one-sided Fisher exact test gives p below 0.1.

Scenario: Arm B has a low Fisher p

  • WHEN the guard reads arm A with 10 successes in 20 first attempts and arm B with 1 success in 20 first attempts
  • THEN the guard returns stop for arm B and reports p below 0.1

Requirement: No stop condition keeps arm B

The eval guard MUST return continue for arm B when neither stop condition holds.

Scenario: The two arms have equal counts

  • WHEN the guard reads arm A and arm B with the same number of successes and first attempts
  • THEN the guard returns continue for arm B

Requirement: The trial ends at the first end event

The eval guard SHALL end the trial at the first of 30 result lines with infra=false, 7 days, or one run of the golden set.

Scenario: The trial reaches 30 attempts

Requirement: First attempt only

The eval guard MUST count only the earliest result line of each item.

Scenario: An item has three result lines

  • WHEN Loki gives three result lines of one item with different results
  • THEN the guard counts only the earliest result line of that item

Requirement: Result line carries the trial name

The stage job SHALL write the trial name in one trial name field of the result line of each attempt.

Scenario: A trial attempt writes its result line

  • WHEN the stage job runs one attempt under the trial arm-b
  • THEN the result line holds trial=arm-b among the name fields, before pipeline=

Requirement: Comment gives the guard values

The eval guard SHALL write the trial name, n, p and the Wilson interval of each arm in one comment on #5501 at each check.

Scenario: The guard comments at a check

Requirement: Pending a person after the merge

After the release, the stage Job MUST run arm B as the App through a #5177 trial.

Scenario: Live trial after the release

Existing Tool Considered

No alternatives check has run (the alternatives answer is null). statsmodels==0.15.0 is already a pinned dependency (pyproject.toml:73), and the existing helper wilson_interval gives the Wilson interval with method="wilson" (src/devops_cli/roadmap/job_grade.py:194). scipy.stats.fisher_exact gives the one-sided Fisher exact test; scipy 1.18.1 already resolves through statsmodels (uv.lock:4498), so the change adds it as a direct pinned dependency in pyproject.toml and downloads no new package. Both are open and maintained. They lack the guard policy: the first-attempt rule, the stop decision, the trial end, the trial name field and the comment. The change writes that policy around them and tests it offline.

Key questions

  • Which library computes the Wilson interval and the one-sided Fisher exact test?: Reuse wilson_interval from devops_cli.roadmap.job_grade, which calls statsmodels.stats.proportion.proportion_confint with method="wilson". Use scipy.stats.fisher_exact with alternative="greater" for the one-sided test, and add scipy==1.18.1 to pyproject.toml as a direct dependency because it already resolves through statsmodels. (best practice) [sources: src/devops_cli/roadmap/job_grade.py:194, pyproject.toml:73, uv.lock:4498]
    • Chosen: statsmodels for Wilson, scipy for Fisher. Both are open and maintained. statsmodels is already a dependency and its Wilson helper exists. scipy is already in the lock through statsmodels.
    • Rejected: A hand-rolled hypergeometric tail and Wilson formula. It needs its own tests against known values, and it can hide an error in the guard.
    • Rejected: R through a subprocess. It adds a runtime that the runner image does not have.
  • Which key holds the trial name in the result line?: The result line holds trial=<name> as one name field. log_job_result writes it through names={"trial": name}, and _name writes other for a name outside [A-Za-z0-9_.-]{1,64}. (best practice) [sources: src/devops_cli/roadmap/job_result.py:8, src/devops_cli/roadmap/job_result.py:356, src/devops_cli/roadmap/job_result.py:392, src/devops_cli/roadmap/job_result.py:56]
    • Chosen: trial. It names the trial directly, stays short and uses the name fields that the line already has.
    • Rejected: trial_name. It repeats the word name, and the line fields are short names.
    • Rejected: A nested meta.trial. The line is flat key=value fields, so a nested value breaks the Loki queries.
  • Where does the guard write the values of each check?: The guard writes one comment on the issue that tracks the grade of the job, with the settings, n, p and the interval of the trial. For the stage A/B run that issue is feat(roadmap): eval stage compares planner input with guide text #5501. The writer is the shared marked-comment step. (best practice) [sources: docs/guidelines/agentic-jobs.md:162, src/devops_cli/roadmap/steps/comment.py:1]
    • Chosen: A comment on feat(roadmap): eval stage compares planner input with guide text #5501. The guideline puts the record of a trial on the issue that tracks the grade of the job, and the A/B run and its guard values then stay on one record.
    • Rejected: A comment on the trial pull request. The pull request closes, and the record is lost.
    • Rejected: A new issue for each check. It floods the roadmap.
  • When does the trial end?: The trial ends at the first of 30 result lines with infra=false, 7 days, or one run of the golden set. (best practice) [sources: docs/guidelines/agentic-jobs.md:156, docs/guidelines/agentic-jobs.md:162]
    • Chosen: The three end events of the guideline. The project records these end events for every trial, so the guard stops on the same events.
    • Rejected: 30 attempts only. A trial that never reaches 30 attempts would run with no end.
    • Rejected: No fixed end. The guard would keep arm B live with no end, and the tuning loop would not move.
  • Does a roadmap job write one result line for each attempt?: Yes. Each roadmap job writes one roadmap job result: line for each attempt, and the Service logs the line as JSON with the line in message. A roadmap step writes one JSON result line and exits 0, 1 or 75. [sources: src/devops_cli/roadmap/job_result.py:1, src/devops_cli/roadmap/job_result.py:21, CONTEXT.md:166]
  • Where does the guard read the attempts of each arm?: The guard reads the roadmap job result: lines of the trial from Loki, as the job grade report does. [sources: src/devops_cli/roadmap/job_grade_report.py:1, src/devops_cli/roadmap/job_grade_report.py:49]

Fit

Fits in one pull request.

Suspected block

the A/B eval run of #5501 adopts arm B, and a release ships the trial mechanism of #5177

Dependencies

#5177

Activity

  1. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    ContributorAuthor
    • Related: feat(roadmap): run the two-engine stage trial #7958, which asks for a different change. Both items run a live stage trial, but #7958 starts a two-engine trial with phase containers, while the candidate extends the #5177 trial to a non-model arm with statistical guard stops.
  2. added
    type/feature
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/medium
    priority/p2-medium
    on Dec 1, 2026
  3. devops-cli-service commented on Dec 1, 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/roadmapsource/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions