Skip to content

feat(roadmap): split thresholds come from measured job history #4817

Not planned

Description

@dan-petty

Problem or Motivation

The owner requirement of 2026-11-11 (#4780) forbids a fixed split constant: a scheduled analysis of the job history must compute the split thresholds.

Measured on 80 items with numbered task groups only:

  • 2 or fewer groups: implement passed 31 of 48 (Wilson interval 0.50-0.77).
  • 3 or more groups: implement passed 11 of 32 (Wilson interval 0.20-0.52).
  • Fisher p = 0.012.
  • But 7 of the 10 limit_reached stops have 2 or fewer groups, so size alone does not cause them.

Nothing computes or records these numbers.

Proposed Solution & Architectural Design

Add devops roadmap split calibrate, with 0 model calls:

  • Join the job records (the listing snapshot) with the OpenSpec change folders at HEAD (numbered groups only). Read Prometheus as a second source.
  • statsmodels 0.15.0 fits proportion_confint (Wilson), a binomial GLM on size and type, and SurvfuncRight for the stall age, on two halves (decision_fit.halves).
  • Rule: a cut needs n >= 30 on each side. Else the step uses the default (explicit split signals, or 2 size-class stops), and the record says so.
  • Write the gauges devops_cli_roadmap_split_threshold{signal,source}, devops_cli_roadmap_split_threshold_samples{signal} and devops_cli_roadmap_split_threshold_window_days, one Loki JSON line, and the Valkey cache roadmap:v1:split-thresholds:<owner>/<name> with a TTL of 8 days.
  • The split run calls the step when the cache is older than 7 days.
  • A seed fixture holds the 80 measured items.

Related

The progress-aware caps plan (tracker "feat(roadmap): track progress-aware caps and fix-before-refuse", when it is filed) also reads the pass rate of the roadmap jobs from measured history. Use one history reader for the two plans. Link this item to that tracker when it is filed.

Target Subsystem

SDLC, Git & PR Governance (roadmap jobs), with telemetry.

Existing Tool Considered

statsmodels 0.15.0 (a dependency already) gives the statistics. Only the queries and the threshold rule are new. Cost to build: about 150,000 tokens and 4 hours.

Acceptance Criteria

  • On the seed fixture, the size threshold is 3 numbered groups with n = 48/32 and source fitted, or source default when the two-halves check fails.
  • A signal with n < 30 gives source default.
  • The result is a pure function of the inputs: 2 runs give equal hashes.
  • 0 model calls.

Dependencies

None.

Source: #4780

Owner decision 2026-11-13

The approved pipeline split (tracker #5482, Phase 5) keeps this scope. The split row (#4819) reads the thresholds.

  • Live proof: after the merge and the release, the thresholds come from the job history of the cluster. A comment gives each threshold, its job and the attempt count that it came from.

Alternatives check of 2026-11-26: 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 fits roadmap split thresholds; statsmodels, already a dependency, gives the Wilson interval, binomial GLM and survival fit, but the history join, sample floor, halves check and outputs stay project code.

Covers:

  • Wilson interval for pass rate by size class
  • Binomial GLM on size and type
  • Survival fit of stall age

Lacks:

  • Join of job records with OpenSpec change folders
  • n >= 30 floor and two-halves check
  • Threshold gauges, Loki line and Valkey cache
  • The calibrate step and its result hash

Proposed design

Problem statement

Build devops roadmap split calibrate with 0 model calls, so the split thresholds come from measured job history instead of a fixed constant, as owner requirement #4780 requires. The item waits on #6521, which holds the re-architecture of the stage, implement and fix-checks jobs. Issue #5817 holds the live proof after the merge and the release. On the 80 measured items, 2 or fewer numbered task groups pass implement 31 of 48 times. Three or more groups pass 11 of 32 times (Fisher p = 0.012). Seven of the 10 limit_reached stops have 2 or fewer groups, so size alone does not cause them.

Acceptance criteria

Requirement: Fitted size threshold

The calibrate step SHALL set the size threshold from the fit on the measured job history when the cut holds on both halves.

Scenario: Seed fixture fit

  • WHEN The calibrate step runs on the seed fixture of 80 items with numbered task groups only.
  • THEN The record gives the size threshold 3 numbered groups, the samples 48 and 32, and source fitted.

Requirement: Two-halves check

The calibrate step MUST fit on one half of the cases, report on the other half, and repeat with the halves swapped.

Scenario: Held-out half refuses the cut

  • WHEN A fixture fits a cut on one half that does not hold on the other half.
  • THEN The record keeps the fit and the report of both halves, and gives source default for that signal.

Requirement: Minimum sample

The calibrate step SHALL give source default for a signal with fewer than 30 attempts on one side of its cut.

Scenario: 29 attempts on one side

  • WHEN A signal has 29 attempts on one side of its cut.
  • THEN The record gives source default for that signal and no fitted cut.

Requirement: Pure function

The calibrate step MUST give equal result hashes for two runs on the same inputs.

Scenario: Two runs

  • WHEN The calibrate step runs twice on the same job records and change folders.
  • THEN The two result hashes are equal.

Requirement: No model call

The calibrate step SHALL make no model request.

Scenario: No model call

  • WHEN The calibrate step runs on the seed fixture.
  • THEN The run records 0 model calls and builds no AI client.

Requirement: Recorded cuts

The calibrate step MUST record each fitted cut as data in the repository, with the date, the fit method, the cases and the numbers.

Scenario: Cuts file

  • WHEN The calibrate step ends with source fitted.
  • THEN The cuts file holds the signal, the threshold, the date, the fit method, the cases and the numbers, and the step refuses a cuts file whose cut no recorded fit gives.

Requirement: Threshold gauges and log line

The calibrate step SHALL write the three threshold gauges and one Loki JSON line.

Scenario: Outputs of one run

  • WHEN The calibrate step ends on the seed fixture with a fake metric sink and a fake log sink.
  • THEN The sinks hold devops_cli_roadmap_split_threshold{signal,source}, devops_cli_roadmap_split_threshold_samples{signal}, devops_cli_roadmap_split_threshold_window_days and one Loki JSON line.

Requirement: Cache entry

The calibrate step SHALL write the cache entry with a TTL of 8 days.

Scenario: Cache key of one run

  • WHEN The calibrate step ends on the seed fixture with a fake cache.
  • THEN The fake cache holds the key roadmap:v1:split-thresholds:<owner>/<name> with a TTL of 8 days.

Requirement: Freshness check

The calibrate step SHALL write a new record when the cache entry is older than 7 days.

Scenario: Stale record

  • WHEN The cache entry is 8 days old and the calibrate step runs.
  • THEN The step reads the job records again and writes a new entry with a TTL of 8 days.

Existing Tool Considered

statsmodels/statsmodels (https://github.com/statsmodels/statsmodels), BSD-3-Clause, maintained, last activity 2026-11-20, in use in this repository (statsmodels==0.15.0, pyproject.toml:73). It covers the Wilson proportion_confint interval, the binomial GLM on size and type, and the survival fit SurvfuncRight for the stall age. The alternatives block of 2026-11-21 in the issue body gives what the tool lacks. The project code that remains has a written cost of about 150,000 tokens and 4 hours.

Key questions

  • Does the approved pipeline split keep this scope, and which row reads the thresholds?: The owner decision of 2026-11-13 keeps this scope under tracker feat(roadmap): track the roadmap pipeline split into jobs #5482, Phase 5. ADR 0021 puts the calibrate step in the split row: the row reads the thresholds, and it runs the calibrate step when the cached thresholds are older than 7 days. The calibrate step writes the record and applies no split. Row feat(roadmap): the split row files the parts of a stalled item #4819 is the split row. (best practice) [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:160, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:161, docs/ROADMAP_WORKFLOW.md:481]
  • Does the freeze of 2026-11-20 stop this item, and what does it wait on?: The reply of 2026-11-20 freezes the item: the stage, implement and fix-checks jobs grade under 60%, and the owner rule asks for a re-architecture under tracker refactor(roadmap): re-architect stage and implement on Coder #6519. The item waits on chore(roadmap): hold incremental stage and implement work #6521, the hold issue. Refine reads the hold line - #6521 (hold: ... of #6519) as a blocker, and chore(roadmap): hold incremental stage and implement work #6521 is no tracker, so it holds the item back. A person closes chore(roadmap): hold incremental stage and implement work #6521 when the experiments of refactor(roadmap): re-architect stage and implement on Coder #6519 decide, or closes this item as not planned. (best practice) [sources: docs/roadmap/refine.md:24, docs/roadmap/refine.md:32]
  • Which library gives the Wilson interval, the binomial fit and the survival fit?: Use statsmodels 0.15.0, which the repository already uses (pyproject.toml:73). proportion_confint gives the Wilson interval (src/devops_cli/roadmap/job_grade.py:194), a binomial GLM gives the fit on size and type, and SurvfuncRight gives the stall age. The alternatives check in the issue body gives the verdict in-use. (best practice) [sources: pyproject.toml:73, src/devops_cli/roadmap/job_grade.py:194, docs/guidelines/agentic-jobs.md:80]
    • Chosen: statsmodels. It is an existing dependency, it is maintained, and it gives all three fits.
    • Rejected: scipy.stats alone. It gives the interval, but the binomial fit and the survival fit need more project code.
    • Rejected: Project code for each fit. It adds code to keep and to fix, and the library gives the same result.
  • Where is the fitted threshold recorded, so that the cache is never the only copy, and which part refreshes it?: Record each fitted cut as data in the repository, in a cuts file with the date, the fit method, the cases and the numbers. Write the Valkey entry as a derived cache with a TTL of 8 days under roadmap:v1:split-thresholds:<owner>/<name>. The calibrate step writes a new record when the entry is older than 7 days. The split row feat(roadmap): the split row files the parts of a stalled item #4819 reads the record, and a missing entry falls back to the cuts file. The job records stay the source. (best practice) [sources: docs/adr/0019-a-decision-step-asks-jev-short-closed-questions-about-evidence-that-tools-extract.md:31, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:161, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:166, src/devops_cli/roadmap/alternatives_cuts.json:1]
    • Chosen: A cuts file in the repository plus a Valkey cache. ADR 0019 puts the fitted values in the repository, and a cache is no durable record.
    • Rejected: A Valkey cache only. A key with a TTL is never the only copy of a decision.
    • Rejected: A constant in the code. ADR 0019 refuses a cut in a constant, and owner requirement feat(roadmap): track the issue stewards and persona selection #4780 forbids it.
  • Which source holds the attempts and the size of each item?: Read the job record from the listing snapshot for the item and its stop class, and join it with the result line of each attempt in Loki, which gives one outcome for each attempt, and with the numbered task groups of the item's OpenSpec change folder at HEAD. Write the gauges to Prometheus, and read no second source: its counter devops_cli_service_implement_failures_total has only the labels class and repo. (best practice) [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:161, src/devops_cli/roadmap/job_result.py:9, CONTEXT.md:142, docs/ROADMAP_WORKFLOW.md:207]
    • Chosen: Loki result lines joined with the change folder. The result line holds one outcome for each attempt, and the change folder holds the numbered task groups.
    • Rejected: Prometheus as a second source. Its counters have only the labels class and repo, so a second read adds no case to the fit.
    • Rejected: A new query of the Job pod logs. The Service already writes one result line for each attempt, so a new query reads the same data twice.
  • What is the smallest sample that allows a fitted cut?: A cut needs 30 attempts on each side. Below that the record gives source default. ADR 0021 says a side with fewer than 30 samples uses the default, and the job grade already calls fewer than 30 attempts too few. (best practice) [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:161, CONTEXT.md:142, docs/guidelines/agentic-jobs.md:79]
    • Chosen: 30 attempts on each side. It matches the too few floor of the job grade and the ADR 0021 rule.
    • Rejected: 10 attempts on each side. A Wilson interval on 10 attempts is wider than the difference between the two size classes.
    • Rejected: No floor. A cut on a few attempts is a guess, and ADR 0019 refuses a guess.
  • What does the calibrate step do when the fit gives no cut for a signal?: The calibrate step records source default with the reason and gives no threshold for that signal. The split row feat(roadmap): the split row files the parts of a stalled item #4819 keeps the default that the issue body names: the explicit split signals (stage.needs_split, refine.needs_split), or 2 size-class stops. A fitted number with no fit of the current history is a constant again. (best practice) [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:158, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:161, docs/adr/0019-a-decision-step-asks-jev-short-closed-questions-about-evidence-that-tools-extract.md:31]
    • Chosen: Record default and keep today's rule. A point with no fitted cut does what it does today.
    • Rejected: Use the seed-fixture cut of 3. A fitted number with no fit of the current history is a constant again.
    • Rejected: Fit on the whole history with no halves check. A fit with no held-out half gives no evidence that the cut holds.
  • How do the calibrate step and the progress-aware caps plan share one history reader?: Put the reader and the fits in a module of their own, as decision_fit.py does today: fit_cuts, evaluate_cuts and halves are pure functions of the cases. The calibrate step calls it, and the progress-aware caps plan calls it when it is filed. Do not put the reader in the command. (best practice) [sources: src/devops_cli/roadmap/decision_fit.py:1, docs/adr/0019-a-decision-step-asks-jev-short-closed-questions-about-evidence-that-tools-extract.md:42]
    • Chosen: A module of its own. Both plans call one reader, and the tests of the reader run with no command.
    • Rejected: The reader inside the command. The second plan would copy it, and the copies would drift.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#6521

Moved to new items

#5817

Activity

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

    @dan-petty
    OwnerAuthor

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

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It fulfills an owner requirement but the system has a default fallback for split thresholds.
    • Value: Medium. It improves split accuracy for roadmap jobs but a default rule already exists.
    • Effort: Medium. Requires statsmodels integration, multiple output sinks, and a seed fixture.
    • Related: feat(roadmap): set the stage planner caps from a week of cut data #4218, which asks for a different change. Both calibrate roadmap parameters from measured job history, but the candidate sets split thresholds while #4218 sets stage planner caps.
  4. added
    priority/p2-medium
    on Nov 11, 2026
  5. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Alternatives check: in-use

    Reason: Searches found no dedicated tool that computes split thresholds from a job history; statsmodels is the only maintained library the searches support, and the issue itself names it as the existing dependency that gives the statistics. It covers only the statistical fits (Wilson intervals, binomial GLM, survival), while the history join, the threshold rule and the output sinks remain project code, so it covers a part of the need.

    The repository already uses this tool.

    Tool: statsmodels/statsmodels (https://github.com/statsmodels/statsmodels)

    • License: BSD-3-Clause
    • Last activity: 2026-11-11
    • Maintained: yes

    Covers:

    • Wilson proportion_confint intervals for the pass rates
    • Binomial GLM on size and type
    • Survival fit (SurvfuncRight) for the stall age
    • Statistical fitting for the threshold rule

    Lacks:

    • Joins the job records with the OpenSpec change folders at HEAD
    • Reads Prometheus as a second source
    • The n >= 30 rule and the default fallback that picks the threshold
    • Writes the gauges, the Loki line and the Valkey cache entry
    • The seed fixture of the 80 measured items

    Tools considered:

    Searches run:

    • statsmodels proportion_confint Wilson interval binomial GLM documentation, results: 5
    • python library compute decision threshold from historical data confidence interval, results: 5
    • statsmodels docs stats.proportion_confint, results: 5
    • statsmodels survival SurvfuncRight documentation, results: 5
    • statsmodels python, results: 5
    • calibrate thresholds from job history telemetry, results: 5
    • pypi statsmodels statistical tests regression survival analysis package, results: 5
    • optbinning library optimal cut points python, results: 5

    Sources:

    Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.

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

    @devops-cli-service
    Contributor

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

    Moved to new items: #5817.

  8. 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.

  9. added
    status/new
    and removed
    status/ready
    on Nov 26, 2026
  10. devops-cli-service commented on Nov 26, 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.

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

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: in-use, tool https://github.com/statsmodels/statsmodels. A person decides what the new result means for the item.

    Searches (6)

    Tools considered:

    Searches run:

    • open source tool calibrate decision thresholds from historical job data statistically, results: 5
    • Python library Wilson confidence interval binomial GLM Kaplan-Meier survival analysis statsmodels, results: 5
    • statsmodels proportion_confint Wilson interval SurvfuncRight documentation, results: 5
    • "SurvfuncRight" statsmodels survival function example, results: 5
    • statsmodels stats.proportion_confint, results: 5
    • python statsmodels generalized linear model binomial family proportion test documentation site, results: 5

    Sources:

  12. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor

    Triage under #6519 (owner instruction of 2026-11-30), before the hold #6521 closes. This item adds or extends a gate, refusal, screen, cap, limit, retry, result line, shell allowlist, tool catalog or plan-shape rule of the stage, implement or fix-checks job. #6519 found that 263 of about 900 issues in four weeks added such rules and none replaced the engine. Stage now runs on stock Coder (grade 60 on 30 graded attempts), where the agent reads the repository, runs the checks in its loop and has a real shell; implement follows (#6527). The code paths that this item names have also moved. If the failure class still shows in graded attempts, file a new item from that evidence. Closed as not planned; a person may reopen it.

  13. removed
    status/new
    on Nov 30, 2026
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/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions