Skip to content

feat(roadmap): Split the job grades by the effort of each item #6008

Open

Description

@dan-petty

Problem

The job result lines (roadmap job result: job=... item=#N result=... success=... class=...) carry no effort of the item, so devops roadmap eval grades cannot split a job's rate by effort. A measure on 2026-11-16 had to join each item to its current effort/* label by hand (.data/agent/scratch/effort-corr/, not in git):

Stage, 2026-11-12 to 2026-11-16 low medium high
Attempts that opened a plan 11/17 (65%) 31/69 (45%) 3/10 (30%)
Items with any success 85% of 13 65% of 46 43% of 7

An ordered trend test gave p of about 0.05 (one-sided). Implement showed no relation (low 2/7, medium 4/21, p of about 0.45). The eventual merge rate of the bot's plan PRs did not fall with effort (low 10/15, medium 44/49, high 4/4). A label read later can differ from the label at the attempt, and Loki keeps the result lines for only about 4.5 days.

Expected behavior

  • Each stage and implement result line carries effort=<low|medium|high|none> from the item's labels at the time of the attempt (and value= if it costs nothing more).
  • devops roadmap eval grades --by effort (or a column in the JSON output) shows each job's attempts, successes and Wilson range for each effort.
  • A test checks the field in the result line and the split in the report.

Related

Alternatives check of 2026-12-01: 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 found no tool that writes the effort field or groups the grade rows. statsmodels gives only the Wilson interval, and the issue already names it as the tool in use.

Covers:

  • Wilson 95% interval for a binomial proportion
  • Several interval methods beside wilson
  • Wilson interval holds the observed rate in the scenario

Lacks:

  • effort= field on the stage and implement result lines
  • Grouping of result lines by effort with an efforts list
  • The --by effort flag and its extra query
  • Read of the effort label at the attempt

Proposed design

Problem statement

The stage and implement result lines hold no effort of the item. devops roadmap eval grades cannot split a job's rate by effort. A label read at report time can differ from the label at the attempt. Loki keeps the result lines for about 4.5 days. The change writes effort= at the attempt and adds a Wilson split for each effort. The item waits on dependency #6521.

Acceptance criteria

Requirement: The effort on the stage and implement result line

Each stage and implement result line SHALL carry effort= with low, medium, high or none, taken from the item's effort/* label at the attempt.

Scenario: A low-effort item and an item with no effort label

  • WHEN A stage attempt of an item that holds effort/low and a stage attempt of an item with no effort/* label log their result lines.
  • THEN uv run devops ci test tests/roadmap/test_job_result.py tests/roadmap/stage/test_roadmap_stage_job_entry.py tests/roadmap/implement/test_roadmap_implement_submit.py passes, and the lines hold effort=low and effort=none after first_pass=.

Requirement: The effort split of the report

With --by effort, devops roadmap eval grades SHALL group the attempts of each workflow and repository by the effort= field of its result lines, count a line with no effort= field as none, and add an efforts list to each workflow row of the JSON report.

Scenario: A line from before the field

  • WHEN The effort query answers with one stage line that holds effort=high and one stage line of the same job and repository with no effort= field.
  • THEN uv run devops ci test tests/roadmap/test_job_grade_report.py passes, the report gives 1 high attempt and 1 none attempt, and the JSON row holds both in its efforts list.

Requirement: Attempts, successes and the Wilson interval for each effort

The --by effort report SHALL give, for each workflow, repository and effort with a line, the attempts with infra=false, the successes, p and the Wilson 95% interval of p.

Scenario: 4 successes in 5 low-effort attempts

  • WHEN The report splits a stage row of 4 successes in 5 low attempts and 1 success in 2 high attempts.
  • THEN uv run devops ci test tests/roadmap/test_job_grade_report.py passes, the low row gives 5 attempts, 4 successes, a p of 0.8 and a Wilson 95% interval that holds 0.8, and the high row gives 2 attempts and 1 success.

Requirement: The flag adds the effort query and the table

devops roadmap eval grades SHALL add the effort query to its plan and print the effort table only when --by effort is set.

Scenario: The dry run with and without the flag

  • WHEN A person runs devops roadmap eval grades --dry-run and devops roadmap eval grades --by effort --dry-run.
  • THEN uv run devops ci test tests/commands/test_roadmap_eval_grades.py passes, the second plan holds one more query that groups the counts by effort, and the first plan holds no effort query and prints no effort table.

Requirement: The split changes no job grade

The --by effort split SHALL NOT change the grade, the attempts or the ratio of the workflow row.

Scenario: A graded row split by effort

  • WHEN The report splits a row of 30 attempts with 24 successes by effort.
  • THEN uv run devops ci test tests/roadmap/test_job_grade_report.py passes, the row keeps its grade, 30 attempts and a p of 0.8, and each effort row carries its own attempts and successes.

Existing Tool Considered

The alternatives check of 2026-11-24 in the issue body gives the verdict in-use for statsmodels (https://pypi.org/project/statsmodels). The block holds what the tool covers and what it lacks. The new report takes the Wilson 95% interval from statsmodels.stats.proportion.proportion_confint. The proposal adds the three parts that the tool lacks: the effort= read at the attempt in src/devops_cli/roadmap/job_result.py, the grouping and the efforts list in the grade report, and the --by effort flag of devops roadmap eval grades. Written cost: about 60k to 80k tokens to build, keep and fix that code, and about one day elapsed.

Key questions

  • Which labels hold the effort of an item?: The effort/* label family holds the effort: effort/low, effort/medium and effort/high. An item with no such label has the effort none. [sources: CONTEXT.md]
  • When does the job read the effort?: At the attempt. The job reads the item's labels when its attempt starts and writes the value into the result line. The report reads no label. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/job_result.py]
    • Chosen: Read at the attempt. The result line is the record of the attempt, and it keeps the label that the attempt saw.
    • Rejected: Join the label at report time. A later label can differ from the label at the attempt, and Loki keeps the lines for about 4.5 days.
  • Which jobs write the new field?: The stage job and the implement job write effort=. (best practice) [sources: src/devops_cli/roadmap/job_result.py, tests/roadmap/test_job_result.py]
    • Chosen: Stage and implement. The issue names both lines, and the split then covers each job that writes the field.
    • Rejected: Stage only. The measure found no relation for implement, and the split must show that result, not hide it.
    • Rejected: Implement only. The issue asks for each stage result line too.
  • What key and value set does the result line hold?: A separate effort= token holds low, medium, high or none in lower case. class= keeps its meaning as the failure class. (best practice) [sources: src/devops_cli/roadmap/job_result.py, tests/roadmap/test_job_result.py]
    • Chosen: A separate effort= token. The line holds flat key=value tokens, and a new key keeps class= for the infrastructure cut.
    • Rejected: Reuse class=. class= is the failure class, and the grade removes the infra=true attempts, so the two values must stay apart.
    • Rejected: A numeric score. CONTEXT.md gives three effort labels, and a score would invent a mapping that no source gives.
  • Where in the line does effort= go?: After first_pass= in the fixed prefix, before the counts and the version. (best practice) [sources: tests/roadmap/test_job_result.py, src/devops_cli/roadmap/job_result.py]
    • Chosen: After first_pass=. The fixed prefix keeps its order, and the existing fields keep their positions.
    • Rejected: After the counts. The field would sit in the variable part with the counts.
  • Does the change add value= to the result line?: No. The change writes effort= only. (best practice) [sources: src/devops_cli/roadmap/job_result.py]
    • Chosen: effort= only. No report reads value=, and the issue asks for the effort split.
    • Rejected: effort= and value=. No report reads value=, so it adds an untested field and more scope.
  • How does the report show the split?: Add the flag --by effort. With the flag the report plans one more count query grouped by effort and prints a second table with one row for each workflow, repository and effort with a line. The JSON report adds an efforts list to each workflow row. (best practice) [sources: CONTEXT.md, docs/roadmap/job-success.md]
    • Chosen: A --by effort flag. It matches the first form in the issue, plans the query only when asked, and keeps the default table.
    • Rejected: A column in the JSON output only. A person reads the table, and a column does not split the rows.
    • Rejected: A separate command. One flag on the existing report is less code and keeps one grade path.
  • What does the report do with a line written before the field?: It counts the line as none. The effort is optional in the parse, and a line with no effort token, or an empty one, goes to the none row. (best practice) [sources: src/devops_cli/roadmap/job_result.py, CONTEXT.md]
    • Chosen: Count it as none. The window holds lines from before the field, and dropping them would hide attempts.
    • Rejected: Leave it out of the split. It drops attempts and gives a rate over a part of the window.
    • Rejected: Refuse the report. Old lines are valid result lines, and the report must keep reading them.
  • Does the split change the job grade?: No. The grade stays the floor of the success ratio over all attempts with no infrastructure cut, with one owner action. The split adds rows and changes no grade. (best practice) [sources: CONTEXT.md, docs/roadmap/job-success.md]
    • Chosen: Keep one grade for the job. The job grade has one owner action, and the issue asks for a split of the rate, not a new grade.
    • Rejected: One grade for each effort. It multiplies the owner actions and gives each effort too few attempts for a grade.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#6521

Activity

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

    @dan-petty
    OwnerAuthor
  3. added
    value/medium
    effort/medium
    priority/p2-medium
    on Nov 16, 2026
  4. devops-cli-service commented on Nov 17, 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 (9)

    Tools considered:

    Searches run:

    • statsmodels proportion_confint Wilson interval, results: 5
    • Python library Wilson score confidence interval for proportions by group, results: 5
    • statsmodels.stats.proportion.proportion_confint method wilson documentation, results: 5
    • scipy stats proportion_ci wilson method confidence interval, results: 5
    • "proportion_confint" statsmodels, results: 5
    • Wilson interval binomial proportion python package, results: 5
    • statsmodels github repository, results: 5
    • confidence interval proportion grouped by category report tool, results: 5
    • wilson score interval calculator, results: 5

    Sources:

  5. added
    status/ready
    and removed
    status/new
    on Nov 18, 2026
  6. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at c62c598 (see proposed design in issue body).

  7. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.

  8. devops-cli-service commented on Nov 24, 2026

    @devops-cli-service
    Contributor

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

    Searches (6)

    Tools considered:

    Searches run:

    • Python library Wilson score confidence interval for a proportion, results: 5
    • statsmodels proportion_confint method wilson documentation, results: 5
    • wilson interval python package pypi proportion confidence interval, results: 5
    • Wilson confidence interval binomial proportion tool, results: 5
    • statsmodels proportion_confint, results: 5
    • python proportion confidence interval library github wilson score, results: 5

    Sources:

  9. added
    status/new
    and removed
    status/ready
    on Nov 27, 2026
  10. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.

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

    @devops-cli-service
    Contributor

    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.

  12. added
    status/ready
    and removed
    status/new
    on Dec 1, 2026
  13. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. 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/p2-mediumscope/roadmapsource/agentstatus/readytype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions