Skip to content

feat(roadmap): set the stage planner caps from a week of cut data #4218

Open

Description

@devops-cli-service

Split from #3241.

Problem: the caps of the stage planner were set by guess. The cut counter devops_cli_roadmap_tool_cuts_total (the first part of #3241) will show which cap cuts an answer.

Why deferred: the part needs one week of cut data after the counter runs in the deployed Service. docs/ROADMAP_WORKFLOW.md also parks each cost change, including a lower cap, until the cloud baseline eval passes.

Acceptance criteria:

  1. Each stage planner cap constant in src/devops_cli/config/constants.py has a comment with the chosen value, the measurement date in ISO 8601 form, the evidence, and for an answer cap the share of answers that it cut.
  2. No answer cap cuts more than 5% of the answers of the week, or its comment gives the reason.
  3. The table LIMITS in tests/roadmap/test_roadmap_limit_classes.py keeps a class and a reason for each changed cap, and the window-fit tests stay green.
  4. The feat(roadmap): add toolset comparison to stage planner eval #3239 comparison runs again on 10 cases after the change, and the report stays with the change.

Related: #3223, #3239, #3240, #3241.

Dependencies

Proposed design

Problem statement

Do not start this item until #6521 closes and #3241 delivers the cut counter. A guess set the stage planner caps, and the counter devops_cli_roadmap_tool_cuts_total will show which cap cuts an answer. The item sets or confirms each cap from one week of cut data and records the value, date, evidence and cut share in the code. It also keeps LIMITS and the window-fit tests valid and records the #3239 comparison. It waits for the week of data and the cloud baseline eval.

Acceptance criteria

Requirement: Cap comment holds the measurement

Each stage planner cap in src/devops_cli/config/constants.py that LIMITS lists with a class other than other SHALL have a comment with value <n>, measured <YYYY-MM-DD> and evidence: <text>.

Scenario: A cap comment lacks a marker

  • WHEN uv run devops ci test tests/roadmap/test_roadmap_limit_classes.py reads the comment above each such constant.
  • THEN The test fails for a comment with no value clause, no ISO 8601 measured date, or no evidence: clause.

Requirement: Answer cap cut share stays under 5 percent or gives a reason

An answer cap SHALL have a cut share <pct>% clause and MUST NOT cut above 5% of the week's answers without a reason: <why> clause.

Scenario: An answer cap exceeds 5% with no reason

  • WHEN uv run devops ci test tests/roadmap/test_roadmap_limit_classes.py reads the cut share of each name in ANSWER_CAPS.
  • THEN The test fails when the share is above 5 and the comment has no reason: clause.

Requirement: Answer cap list matches the recorded shares

ANSWER_CAPS in tests/roadmap/test_roadmap_limit_classes.py SHALL name exactly the stage planner caps whose comments hold a cut share clause.

Scenario: A list entry is not a cap or a cap with a share is missing

  • WHEN uv run devops ci test tests/roadmap/test_roadmap_limit_classes.py reads each name in ANSWER_CAPS and each cap comment with a cut share clause.
  • THEN The test fails for a name that is not a numeric cap in LIMITS, and for an omitted cap with a cut share clause.

Requirement: Limit class table stays valid

Each changed stage planner cap SHALL keep a class and a reason in LIMITS of tests/roadmap/test_roadmap_limit_classes.py, and the window-fit tests SHALL stay green.

Scenario: A cap value changes

  • WHEN uv run devops ci test tests/roadmap/test_roadmap_limit_classes.py runs after a cap value changes.
  • THEN The test fails for a changed cap with no class or no reason, and each window-fit test passes.

Requirement: Comparison report records the score before and after

The change SHALL run the #3239 comparison on 10 cases and SHALL record the score before and after in its comparison-report.md.

Scenario: The change folder holds the comparison result

  • WHEN uv run devops ci test tests/roadmap/test_roadmap_limit_classes.py reads comparison-report.md in openspec/changes/4218-* or openspec/changes/archive/4218-*.
  • THEN The test fails when the file is absent or holds no score before and no score after on 10 cases.

Existing Tool Considered

No alternatives check has run. Prometheus is the open, maintained tool that covers the measurement: the project already runs it and the counter devops_cli_roadmap_tool_cuts_total is in src/devops_cli/telemetry/instruments.py. Prometheus lacks cap selection and the 5% policy; the change applies both by hand. The change adds no planner code, so the written cost is about 2 hours after the week of data, plus the eval and comparison runs.

Key questions

  • What blocks the item now?: The item waits on chore(roadmap): hold incremental stage and implement work #6521, the hold for incremental work on the stage, implement and fix-checks jobs, and on feat(roadmap): Tune stage planner caps from run data #3241 for the cut counter. It also needs one week of cut data and a passing cloud baseline eval. Stage and implement leave the item while chore(roadmap): hold incremental stage and implement work #6521 is open. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, src/devops_cli/telemetry/instruments.py]
  • How does the change measure the cut share?: Query Prometheus over the 7 days after the counter deploys. Divide cuts that name a cap by answers of the same tool in that week. Record the query date and query text in the cap comment. (best practice) [sources: src/devops_cli/prometheus/analysis.py, src/devops_cli/telemetry/instruments.py]
    • Chosen: Prometheus query over 7 days. The project already runs Prometheus, and src/devops_cli/prometheus/analysis.py reads the counter.
    • Rejected: Read /metrics of one pod. It gives the current value only, and a restarted pod loses the week.
    • Rejected: New script that reads Job logs. It adds code to keep and gives the same number.
  • Which constants are stage planner caps?: The numeric stage planner cap constants in src/devops_cli/config/constants.py that LIMITS lists with a class other than other. (best practice) [sources: src/devops_cli/config/constants.py, tests/roadmap/test_roadmap_limit_classes.py:95]
    • Chosen: Numeric caps in LIMITS with a class other than other. The table registers each cap, and a test keeps it in step with the code.
    • Rejected: Every numeric stage planner constant. It includes schedule and policy values that cut no run.
    • Rejected: A hand-kept list in the change. It drifts from the code, and no test holds it.
  • Which caps are answer caps?: The caps whose labels devops_cli_roadmap_tool_cuts_total names after the week of data. Record them in ANSWER_CAPS of tests/roadmap/test_roadmap_limit_classes.py. (best practice) [sources: src/devops_cli/telemetry/instruments.py, tests/roadmap/test_roadmap_limit_classes.py]
    • Chosen: Take the caps from the counter labels after the week. The list follows the data, and the test module records it for the cut-share test.
    • Rejected: Fix the list now. The label set is unknown before the week of data.
    • Rejected: Take every cap in LIMITS. Some caps protect a log, a secret or an external service and cut no answer.
  • What comment form holds the evidence?: One comment block above each constant with value <n>, measured <YYYY-MM-DD>, evidence: <query and counts>, and for an answer cap cut share <pct>%. A share above 5% adds reason: <why>. (best practice) [sources: src/devops_cli/config/constants.py, tests/roadmap/test_roadmap_limit_classes.py]
    • Chosen: One comment block with fixed markers. The markers let a test check the date, the evidence and the share.
    • Rejected: Free prose in the comment. A test cannot tell a date from another number or a share from another percentage.
    • Rejected: A separate data file. The issue asks for the evidence in the comment, and a second file can drift from the value.
  • Where does the comparison report stay?: In comparison-report.md in the change folder, with the score before and the score after on 10 cases. (best practice) [sources: CONTEXT.md]
    • Chosen: comparison-report.md in the change folder. The change folder is the in-repo record, and the report is archived with it.
    • Rejected: A section in design.md. design.md holds design decisions, not a measurement report.
    • Rejected: A comment on the pull request. A person must read it, it does not travel with the repository, and no test checks it.

Fit

Fits in one pull request.

Suspected block

Waits for one week of cut data from devops_cli_roadmap_tool_cuts_total after #3241 and for the cloud baseline eval to pass.

Dependencies

#6521, #3241

Activity

  1. added
    type/feature
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 9, 2026
  2. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    ContributorAuthor

    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: P3-Low. The calibration waits for one week of cut data and a passing cloud baseline eval.
    • Value: Medium. Data-based caps improve plan quality and stop caps that cut useful answers.
    • Effort: Medium. The work needs one week of data, new cap comments, table updates and a rerun of the #3239 comparison.
    • Related: feat(roadmap): Tune stage planner caps from run data #3241, which asks for a different change. Both tune the stage planner caps, but #3241 sets all caps from run data and this split sets the answer caps from one week of cut data.
  3. added
    priority/p3-low
    on Nov 9, 2026
  4. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    ContributorAuthor

    Refine cannot set this item to Ready at 6121d09 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.

    The next refine round also looks at the item again when a commit on the default branch changes one of these files: docs/ROADMAP_WORKFLOW.md.

  5. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    ContributorAuthor

    Refine cannot set this item to Ready at 996c8a2 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.

    The next refine round also looks at the item again when a commit on the default branch changes one of these files: src/devops_cli/roadmap/stage/stage_toolbox.py, src/devops_cli/telemetry/metrics.py.

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

    @devops-cli-service
    ContributorAuthor

    Refine cannot set this item to Ready at 9a821c8 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.

    The next refine round also looks at the item again when a commit on the default branch changes one of these files: docs/ROADMAP_WORKFLOW.md.

  7. devops-cli-service commented on Nov 10, 2026

    @devops-cli-service
    ContributorAuthor

    Refine cannot set this item to Ready at 04db2fc 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.

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

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  9. dan-petty commented on Nov 20, 2026

    @dan-petty
    Owner

    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.

  10. devops-cli-service commented on Nov 23, 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/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