Skip to content

feat(roadmap): find a success or efficiency change after a release #5175

Open

Description

@dan-petty

Part of #5164 (child 10, long term).

Problem or Motivation

The result line holds version=. On 2026-11-12, 4 versions wrote lines in about 4.4 hours (0.118.0, 0.119.0, 0.120.0, 0.120.1). The project ships many releases a day, so one version seldom has enough attempts for a ratio. No check says that a release made a workflow fail more often, or use more tokens or time for each success. The owner asked for gauges tuned to the project history and for efficiency work at 80% or more (#5164).

Proposed Solution & Architectural Design

Design note (in the OpenSpec change of this item):

  • For each version V of a workflow, compare the attempts from the first line of V to now (at most 7 days) with the 7 days before the first line of V.
  • Success: statsmodels.stats.proportion.test_proportions_2indep (score method). Signal when p < 0.05, both sides have 20 or more attempts, and the ratio fell.
  • Efficiency: scipy.stats.mannwhitneyu on tokens and on seconds for each successful attempt. Signal when p < 0.05 with 10 or more on each side and the median rose.
  • devops roadmap eval grades --since-version <V> prints the compare. The grade-check step of child 8 adds the signal to the issue of the workflow, with the version and the commits of the range.
  • A Grafana annotation marks the first line of each version on the gauge row of feat(roadmap): a dashboard and alerts for the pipeline #3655.
  • If one test for each version is too noisy, evaluate ruptures (BSD-2) for change points on the daily ratio, in a later item.

Target Subsystem

SDLC, Git & PR Governance (src/devops_cli/roadmap/).

Existing Tool Considered

statsmodels (a current dependency) and SciPy (a dependency of statsmodels; add it as a direct dependency). Cost: about 250,000 tokens, 6 hours elapsed.

Acceptance Criteria

  • A fixture with 40 attempts at 0.90 before and 30 at 0.60 after gives a success signal. 30 at 0.85 after gives none.
  • A fixture with median tokens 1.0M before and 2.0M after (10 or more each) gives an efficiency signal.
  • --since-version with fewer attempts than the minimum prints too few and no p-value.

Dependencies

#5165, #5168.

Alternatives check of 2026-11-19: in-use.
The repository already uses this tool.
Tool: statsmodels (https://pypi.org/project/statsmodels), BSD-3-Clause, last activity 2026-08-30, maintained.
Reason: Searches surfaced no dedicated release-regression tool; statsmodels, already a dependency the issue names, supplies the two-proportion test, the BH correction and GLMs, but not the Mann-Whitney comparison, window rules or signal output.

Covers:

  • Score-method test for two independent proportions
  • Benjamini-Hochberg correction over many comparisons
  • Poisson GLM families for rate differences
  • Bootstrap and permutation helpers for ratios

Lacks:

  • No Mann-Whitney U test on tokens and seconds
  • No quasi-Poisson family for overdispersed counts
  • No before/after version window or gap rule
  • No grade signal, marker format or CLI

Proposed design

Problem statement

The project ships many releases a day, so one version seldom has enough attempts for a ratio, and no check says whether a release made a workflow fail more often or use more tokens or time for each success. This item compares the attempts of each version with the period before its first merge, gives a success signal and an efficiency signal, and prints the compare with devops roadmap eval grades --since-version. The reply for #5219 adds one shared devops-signal link format and an effect module for job ratios, so the work no longer fits one pull request; it splits into the compare, the signal link, the effect estimators and the Grafana annotation.

Acceptance criteria

Requirement: version-window

The compare SHALL use only the attempts from the first result line of a version to now, capped at 7 days, and the 7 days before the first merge of the version, and SHALL leave out the gap between that merge and the first line.

Scenario: window-bounds

  • WHEN A fixture places result lines inside the after window, inside the before window, in the gap after the version's first merge and before its first result line, and outside both windows.
  • THEN The compare function returns only the attempts in the two windows.

Requirement: success-signal

The success check SHALL use statsmodels.stats.proportion.test_proportions_2indep with the score method and SHALL signal only when p < 0.05, both sides have at least MIN_ATTEMPTS attempts and the ratio fell.

Scenario: success-falls

  • WHEN A fixture has 40 attempts at 0.90 before and 30 attempts at 0.60 after.
  • THEN The compare function returns a success signal.

Requirement: success-no-signal

The success check SHALL NOT signal a fall when the after ratio is 0.85 or higher for the same attempt counts.

Scenario: success-does-not-fall

  • WHEN A fixture has 40 attempts at 0.90 before and 30 attempts at 0.85 after.
  • THEN The compare function returns no success signal.

Requirement: efficiency-signal

The efficiency check SHALL use scipy.stats.mannwhitneyu on tokens and seconds for each successful attempt and SHALL signal only when p < 0.05, each side has at least 10 successful attempts and the median rose.

Scenario: tokens-double

  • WHEN A fixture has median tokens 1.0M before and 2.0M after with 10 or more successful attempts on each side.
  • THEN The compare function returns an efficiency signal for tokens.

Requirement: too-few

The compare command SHALL print too few and no p-value when an attempt count is below MIN_ATTEMPTS.

Scenario: below-minimum

  • WHEN A fixture has 25 attempts before and 15 attempts after for one version.
  • THEN The command output contains too few and contains no p-value.

Requirement: paged-read

The result-line reader SHALL read all pages of result lines.

Scenario: two-pages

  • WHEN A fake client returns two pages of result lines.
  • THEN The reader returns the lines of both pages.

Requirement: signal-link-parse

The devops-signal parser SHALL accept only a number or a boolean in value, known fields and at most 20 lines.

Scenario: invalid-signal

  • WHEN The input has a string value, an unknown field or 21 lines.
  • THEN The parser raises SignallinkError.

Requirement: signal-link-job-grade

The devops-signal parser SHALL read a devops-job-grade marker as a job_grade link.

Scenario: job-grade-marker

  • WHEN The input has a devops-job-grade marker.
  • THEN The parser returns a job_grade link.

Requirement: signal-link-format

The formatter SHALL write a devops-signal block that parses back to the same link.

Scenario: round-trip

  • WHEN A valid link is formated and parssed again.
  • THEN The parssed link equals the input link.

Requirement: effect-worse

The effect module SHALL return worse for a job ratio that falls from 0.90 to 0.60 across 40 item units on each side.

Scenario: ratio-worse

  • WHEN A fixture has 40 items at 0.90 before and 40 items at 0.60 after.
  • THEN The effect module returns worse.

Requirement: effect-too-few

The effect module SHALL return too few when either side has fewer than MIN_ATTEMPTS attempts.

Scenario: effect-too-few

  • WHEN A fixture has 25 attempts before and 15 attempts after.
  • THEN The effect module returns too few.

Requirement: effect-measure-check

The effect module SHALL return check the measure when the after side has 30 successes out of 30 attempts.

Scenario: all-success

  • WHEN A fixture has 30 of 30 successes after the change.
  • THEN The effect module returns check the measure.

Requirement: effect-guard

The effect module SHALL return not shown for a guard change from 0.85 to 0.83 and held for 200 attempts at 0.85 and 200 at 0.84 with margin 0.10.

Scenario: guard-margin

  • WHEN A fixture has a guard change of 0.85 to 0.83, and a second fixture has 200 at 0.85 and 200 at 0.84 with margin 0.10.
  • THEN The effect module returns not shown for the first fixture and held for the second fixture.

Requirement: effect-target-fell

The effect module SHALL return fell for a target that drops from 60 to 6 records with a flat control.

Scenario: target-falls

  • WHEN A fixture has 60 target records before and 6 after, and a flat control.
  • THEN The effect module returns fell.

Requirement: effect-outlier

The effect module SHALL return not shown when one hour holds more than 25% of the bad events.

Scenario: bad-event-cluster

  • WHEN A fixture puts more than 25% of the bad events in one hour.
  • THEN The effect module returns not shown.

Requirement: multiple-comparisons

The compare command SHALL apply Benjamini-Hochberg correction across the version comparisons before it emits a verdict.

Scenario: one-of-twenty

  • WHEN A fixture has 1 compare at p = 0.04 and 19 compares at p = 0.9.
  • THEN The command emits no verdict.

Requirement: failed-cost-efficiency

The efficiency check SHALL include the tokens and seconds of failed attempts in the cost per success.

Scenario: failed-cost-doubles

  • WHEN A fixture doubles the cost of failed attempts and keeps equal success medians.
  • THEN The compare function returns an efficiency change.

Requirement: annotation

The command SHALL emit a Grafana annotation at the first result line of each version.

Scenario: annotation-payload

  • WHEN A fixture has a first result line at a known time for a version.
  • THEN The annotation payload has that time and the version tag.

Existing Tool Considered

statsmodels is in use (verdict in-use); the Lacks: list of the alternatives block states what it does not cover. SciPy supplies the test that list names, and the change adds the window rule, the devops-signal format, the effect estimators and the CLI output that statsmodels does not provide. The issue writes the cost of the code the project builds, keeps and fixes at about 250,000 tokens and 6 hours elapsed.

Key questions

  • Which libraries implement the success and efficiency tests?: Use statsmodels.stats.proportion.test_proportions_2indep with the score method for success and scipy.stats.mannwhitneyu for tokens and seconds. statsmodels is a pinned dependency and already gives the Wilson interval in roadmap/job_grade.py. SciPy 1.18.1 is in the lock as a dependency of statsmodels, and the change makes it a direct dependency. ruptures is not used now. (best practice) [sources: pyproject.toml:73, uv.lock:4368, src/devops_cli/roadmap/job_grade.py:198, https://pypi.org/project/statsmodels]
    • Chosen: statsmodels and SciPy. They are maintained dependencies, and statsmodels is pinned while SciPy is in the lock.
    • Rejected: Custom normal approximation. It adds code to keep and test and does not use the maintained implementation.
    • Rejected: ruptures now. It detects change points but gives no two-sample test.
  • What is the devops-signal line format?: One hidden HTML comment block, &lt;!-- devops-signal {...} -->, with at most 20 lines that hold one JSON object. Its known fields are kind, value, job, item, version, at and source; value is a number or a boolean only; an unknown field, a string value or a 21st line is refused with SignallinkError. The parser reads markdown-it html_block tokens as split_record does, the devops-job-grade marker reads as a job_grade link, and the formatter writes the same block. (best practice) [sources: docs/adr/0016-labels-hold-the-roadmap-items-fields.md:19, src/devops_cli/roadmap/stores/store.py:851, src/devops_cli/roadmap/stores/store.py:884, pyproject.toml:70]
    • Chosen: One shared module and schema. Intake, the writers and the review import one format, and ADR 0016 holds one hidden block form.
    • Rejected: Separate parsers. They drift and duplicate validation.
    • Rejected: Free-form Markdown. It cannot refuse a string value or an unknown field.
  • Should ruptures be used now?: No. ruptures is a change-point detector and would add a second method beside the two-sample tests. Evaluate it in a later item only if the per-version test is noisy, as the issue body says. (proposed)
    • Chosen: statsmodels and SciPy now. They give the two-proportion and Mann-Whitney tests that the item needs.
    • Rejected: ruptures now. It detects change points but does not give the two-sample tests.
    • Rejected: No change-point tool later. It remains a fallback if the per-version test is noisy.
  • Should this item include the signal-link and effect modules that the reply adds?: Yes. feat(roadmap): report job grades and fix effects in the project review #5219 waits for this item and reads its compare module, and intake, the writers and the review must import one signal format. The shared module follows the one hidden block form of ADR 0016 and the one html_block parser of split_record. (best practice) [sources: docs/adr/0016-labels-hold-the-roadmap-items-fields.md:19, src/devops_cli/roadmap/stores/store.py:884]
  • Should the Grafana annotation be in this item?: Yes, as its own pull request. The command emits an annotation at the first result line of each version, with the version tag. The row that it marks is the jobs table of feat(roadmap): a dashboard and alerts for the pipeline #3655, so that pull request waits on feat(roadmap): a dashboard and alerts for the pipeline #3655. The annotation is a POST /api/annotations on GrafanaClient, which today reads dashboards and datasources only. (best practice) [sources: src/devops_cli/grafana/client.py:1, docs/DESIGN.md:261]
    • Chosen: Emit annotation in this item. The issue body asks for it and it marks the release boundary.
    • Rejected: Defer annotation. It uses the same version first-line data and is small.
    • Rejected: No annotation. The gauge row then has no release marker.
  • What window rule compares a version with the period before it?: The before side is the 7 days before the first merge of the version, the commit of its release tag. The after side starts at the first result line with that version and is capped at 7 days. The gap between the first merge and the first line stays out. This is one rule for this item and feat(roadmap): report job grades and fix effects in the project review #5219. (best practice) [sources: src/devops_cli/roadmap/job_grade.py:38, docs/roadmap/job-success.md:91, docs/roadmap/job-success.md:68, src/devops_cli/roadmap/release_feed.py:31]
    • Chosen: Merge-to-release window. It ties the before side to the version's first merge and the after side to its first result line.
    • Rejected: Fixed 7 days before the first line. It can include another release.
    • Rejected: Whole version lifetime. It has too few attempts and mixes releases.
  • How many attempts are enough, and how are many version comparisons corrected?: Use MIN_ATTEMPTS from roadmap/job_grade.py, which is 30, in place of the 20 of the issue body. Apply Benjamini-Hochberg across the version comparisons, and use fixed seeds for the permutation and bootstrap. (best practice) [sources: src/devops_cli/roadmap/job_grade.py:81, src/devops_cli/roadmap/job_grade_report.py:97, https://pypi.org/project/statsmodels]
    • Chosen: Reuse MIN_ATTEMPTS and BH. It keeps one minimum for job grades and controls false signals across versions.
    • Rejected: Hard-code 20. It duplicates a limit that job grade already holds, and the value is 30.
    • Rejected: No correction. Many versions make a false signal more likely.
  • Does the grade-check step add the signal to the workflow issue?: That step is child 8, not this item. This item prints the compare with --since-version and exposes the signal, the version and the commit range; child 8's grade-check step writes them to the workflow issue. This item adds no writer for the workflow issue. (best practice) [sources: docs/roadmap/job-success.md:68, docs/guidelines/agentic-jobs.md:33]
    • Chosen: Child 8 writes it. The body places the grade-check step in child 8, and this item supplies the signal, the version and the commit range.
    • Rejected: This item writes it. It adds a writer for a step that this item does not own.
    • Rejected: Only print the compare. Child 8 still needs the signal from this item.
  • Which dependencies remain?: Only feat(roadmap): a dashboard and alerts for the pipeline #3655. feat(roadmap): eval grades prints the grade of each workflow #5165 and feat(roadmap): result lines state first-pass, model calls and cost #5168 are done: their changes are archived and their code is in the tree, in roadmap/job_grade.py and the first-pass fields of roadmap/job_result.py. [sources: openspec/changes/archive/2026-11-12-5165-eval-grades-prints-the-grade-of/proposal.md, openspec/changes/archive/2026-11-15-5168-result-lines-first-pass-calls-cost/proposal.md, src/devops_cli/roadmap/job_grade.py:81, docs/roadmap/job-success.md:19]
  • Does the change fit one pull request?: No. The compare, the shared signal format, the effect estimators and the annotation are four independent changes, and the effect module alone holds the permutation, bootstrap, quasi-Poisson and quasi-binomial estimators. Split into four pull requests; the compare goes first because feat(roadmap): report job grades and fix effects in the project review #5219 reads it. (best practice) [sources: src/devops_cli/commands/roadmap_eval_grades.py:49, src/devops_cli/k8s/logql.py:322, src/devops_cli/roadmap/job_grade_report.py:1]
    • Chosen: Four pull requests. The compare, the signal link, the effect estimators and the annotation are independent.
    • Rejected: One pull request. The reply's modules and fixtures exceed one reviewable change.
    • Rejected: Two pull requests. It groups unrelated modules and still needs a third for the annotation.

Fit

Needs splitting into 4 items:

  1. feat(roadmap): compare attempts by release version
  2. feat(roadmap): add shared devops-signal link format
  3. feat(roadmap): add effect estimators for job ratios
  4. feat(roadmap): annotate release versions on job gauges

Suspected block

None.

Dependencies

#3655

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 12, 2026
  2. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
    • Priority: P3-Low. It is child 10 of #5164, a long-term item with dependencies on #5165 and #5168.
    • Related: feat(roadmap): eval grades prints the grade of each workflow #5165, which asks for a different change. Both extend devops roadmap eval grades, but #5165 adds the base grade print while the candidate adds a --since-version statistical comparison.
  3. added
    priority/p3-low
    on Nov 12, 2026
  4. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Scope change for #5219 (the self-improvement section of the project review). #5219 waits for this item and reads its compare module. Add:

    • roadmap/signal_link.py and signal_link.schema.json: the devops-signal line format, a parser on markdown-it html_block tokens and a formatter. The devops-job-grade marker of feat(roadmap): a daily grade-check step keeps one issue per workflow #5173 reads as a job_grade link. value is a number or a boolean only. A body holds 20 lines or fewer. Intake, the writers and the review import this one module.
    • roadmap/effect.py: an item-unit permutation test and a bootstrap for job ratios, and the ratio estimator for efficiency; a quasi-Poisson difference-in-differences GLM for usage rates; a quasi-binomial GLM for tool rows; the key check; the 90% interval rules for held and no change; check the measure; Benjamini-Hochberg; fixed seeds.
    • The paged read of result lines, and MIN_ATTEMPTS from roadmap/job_grade.py in place of 20.
    • One window rule for this item and feat(roadmap): report job grades and fix effects in the project review #5219: the before side ends at the first merge of the change, the after side starts at the first record of its release, and the gap stays out.

    Fixtures:

    • 40 items at 0.90 before and 40 at 0.60 after give worse. 25 and 15 attempts give too few. 30 of 30 successes after give check the measure.
    • Guard 40 at 0.85 and 40 at 0.83 give not shown. Guard 200 at 0.85 and 200 at 0.84 with margin 0.10 give held.
    • Target 60 to 6 records with a flat control gives fell. One hour with more than 25% of the bad events gives not shown.
    • 1 compare at p = 0.04 and 19 at p = 0.9 give no verdict.
    • A doubled cost of failed attempts with equal success medians gives an efficiency change.
    • A string value, an unknown field and a 21st line are refused.
  5. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (8)

    Tools considered:

    Searches run:

    • python library detect change in success rate after release statistical test, results: 5
    • ruptures change point detection python library, results: 5
    • statsmodels test_proportions_2indep and multipletests Benjamini-Hochberg, results: 5
    • ruptures pypi change point detection, results: 5
    • statsmodels pypi two independent proportions test, results: 5
    • scipy mannwhitneyu documentation, results: 5
    • CausalImpact python pypi before after intervention effect, results: 5
    • "statsmodels" github, results: 5

    Sources:

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

    @devops-cli-service
    Contributor

    Next step: a person splits the item, or replies in a comment or edits the body to keep one item. See Fit 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/p3-lowscope/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