Skip to content

feat(roadmap): a daily grade-check step keeps one issue per workflow #5173

Open

Description

@dan-petty

Part of #5164 (child 8).

Problem or Motivation

The owner wants each grade to drive work: at 100%, check the measure and tighten gates; at 80%, prioritize fixes and fixer jobs; under 60%, re-architect (2026-11-12, #5164). A grade that a person must read on a dashboard turns into no roadmap item. docs/roadmap/job-success.md has a hold rule only for 80%, and nothing files an issue when a job loses it.

Proposed Solution & Architectural Design

  • Add the step devops roadmap step grade-check --repo <owner/repo> (the feat(roadmap): track the Service step jobs #5014 step frame, commands/roadmap_step.py). Run it daily from an Argo CronWorkflow for each Service repository.
  • Held grade. For each workflow, read 14 daily 7-day ratios from Loki (or the recorded series of child 7). A workflow holds a floor F when its p is F or more with 30 or more attempts at 3 daily checks in a row. It keeps F until the Wilson upper bound falls under F. The held grade is the highest floor that it holds. Write this rule into job-success.md in place of the 80% rule.
  • Issues. One issue for each workflow and repository, through intake_candidate with filed_by="agent" and the fingerprint module of feat(roadmap): file, update and close finding issues by fingerprint #5153. Marker: <!-- devops-job-grade: v1 job=<job> repo=<repo> key=<sha256 of repo and job> grade=<g> classes=<sha256 of the top classes> -->.
    • File when the held grade drops, when the grade is 100, or at grade 80 or better when tokens or seconds for each success rise 25% or more against the 28-day median.
    • Title: fix(<scope>): raise the <job> success from <p>% at grade <g>; test(<scope>): check the <job> measure at 100% first pass; perf(<scope>): cut the <job> tokens for each success.
    • Body: the grade, n, the interval, the top 3 failure classes with counts and 3 sample items each, the owner action of the grade, and, at 80 or better, the efficiency measures.
    • Edit the body when the grade or the top classes change. Do nothing when they stay the same. Close as completed when the workflow holds 80 or better for 7 daily checks (grade 100: when no workflow line changed its first-pass rule for 7 days after a merged measure check).
    • Intake sets the priority. The step sets no priority or milestone.
  • Setting roadmap.grade_check.mode (RowMode), default plan. off sends no request. plan reads Loki and GitHub and logs each would-be create, edit and close. on writes. --dry-run sends 0 requests and returns the planned requests.
  • The step writes its own result line (job=grade_check).

Target Subsystem

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

Existing Tool Considered

Alertmanager can send a grade drop to a receiver, but it opens no roadmap issue with intake labels and does not close one. The fingerprint module of #5153 files, edits and closes by marker. Cost: about 350,000 tokens, 10 hours elapsed, then 2 weeks in plan.

Acceptance Criteria

  • A table test of the held grade: entry after 3 checks in a row, no exit at an upper bound of 0.81 under floor 0.80, exit at 0.75.
  • Two runs with the same grades make 1 issue and 0 edits on the second run (fake GitHub session).
  • A grade change edits the body once. 7 daily checks at 80 or better close the issue once.
  • plan mode makes 0 writes. --dry-run sends 0 requests.
  • After 2 weeks in plan, a tracker comment lists the would-be issues, and a person reads 10 of them before on.

Dependencies

#5165 (the grade table), #5168 (first pass and efficiency counts), #5153 (the fingerprint module).

Alternatives check of 2026-11-27: none.
Tool: none found.
Reason: Searches returned no usable result for a tool that reads per-workflow grade ratios, holds a grade with Wilson entry and exit, and files, edits and closes one roadmap issue; alert routers and scheduled issue bots stop at creating an issue.

Lacks:

  • No held grade with entry at 3 checks and exit on the Wilson upper bound
  • No close when a workflow holds 80 or better for 7 daily checks
  • No issue found and updated by a marker holding the class digest
  • No plan mode that logs would-be creates, edits and closes
  • No efficiency check on tokens and seconds for each success

Proposed design

Problem statement

Each roadmap workflow gets a job grade. Each grade has one owner action. A person reads the grade on a dashboard, so the grade changes no roadmap item. docs/roadmap/job-success.md has a hold rule only for 80%, and nothing files an issue when a workflow loses its grade. This item adds a daily grade-check step. The step holds a grade for each workflow. It files, edits and closes one issue for each workflow and repository.

Acceptance criteria

Requirement: Held grade with entry and exit

The grade-check step SHALL hold a workflow's grade with entry after 3 daily checks at or above a floor and exit only when the Wilson upper bound falls below that floor.

Scenario: Entry, hold and exit of one floor

  • WHEN A table test gives p = 0.82 at 3 daily checks in a row, then an upper bound of 0.81 under floor 0.80, then 0.75
  • THEN The held grade enters 80 after the 3 checks, stays 80 at the upper bound of 0.81, and falls at 0.75

Requirement: One issue for each workflow and repository

The grade-check step SHALL file at most one issue for each workflow and repository through intake_candidate with filed_by="agent", MUST find that issue by its hidden marker, and MUST set no priority or milestone.

Scenario: Two runs with the same grades

  • WHEN Two runs read the same grades and use a fake GitHub session
  • THEN The first run creates 1 issue, the second run creates no issue and makes 0 edits, and the step sends no priority or milestone write

Requirement: File on a held-grade drop

The grade-check step SHALL file one issue when the held grade of a workflow drops.

Scenario: A held grade drops from 80 to 70

  • WHEN A run reads a held grade of 80 in the previous series and 70 in the current series
  • THEN The step files 1 issue with the title fix(<scope>): raise the <job> success from <p>% at grade <g>

Requirement: File at grade 100

The grade-check step SHALL file one issue when the held grade is 100.

Scenario: A workflow holds grade 100

  • WHEN A run reads a held grade of 100
  • THEN The step files 1 issue with the title test(<scope>): check the <job> measure at 100% first pass

Requirement: File on an efficiency rise

The grade-check step SHALL file one issue at grade 80 or better when tokens or seconds for each success rise 25% or more against the 28-day median.

Scenario: An efficiency rise at grade 80

  • WHEN The held grade stays 80 and the tokens for each success rise 25% or more against the 28-day median
  • THEN The step files 1 issue with the title perf(<scope>): cut the <job> tokens for each success

Requirement: The issue body holds the grade facts

The filed issue body SHALL hold the grade, n, the interval, the top 3 failure classes with counts and 3 sample items each, the owner action of the grade, and at 80 or better the efficiency measures.

Scenario: A filed issue at grade 80

  • WHEN The step files an issue at grade 80 with a fake GitHub session
  • THEN The issue body holds the grade, n, the interval, the top 3 failure classes with counts and 3 sample items each, the owner action, and the efficiency measures

Requirement: Body edit on a change of grade or classes

The grade-check step SHALL edit the issue body once when the grade or the top failure classes change, and MUST make no edit when they stay the same.

Scenario: A changed top failure class

  • WHEN A run reads the same grade and a different top failure class
  • THEN The step edits the body once and the marker holds the new class digest

Requirement: Close on 7 daily checks at 80 or better

The grade-check step SHALL close the issue as completed once the workflow holds 80 or better for 7 daily checks.

Scenario: Seven daily checks at grade 80

  • WHEN The daily series holds 80 or better at 7 checks in a row
  • THEN The step closes the issue once

Requirement: Close at grade 100 after a stable first-pass rule

The grade-check step SHALL close the issue as completed at grade 100 when no workflow line changed its first-pass rule for 7 days after a merged measure check.

Scenario: Seven days after a merged measure check

  • WHEN The grade is 100 and no workflow line changed its first-pass rule for 7 days after a merged measure check
  • THEN The step closes the issue once

Requirement: Plan mode and dry run

The step SHALL send no issue create, edit or close in plan mode, MUST log each would-be create, edit and close, and MUST send no request at all with --dry-run.

Scenario: A plan-mode run with 2 would-be creates

  • WHEN The step runs in plan mode with a fake GitHub session and 2 would-be creates
  • THEN The step logs the 2 would-be creates and sends 0 issue writes, and --dry-run sends 0 requests

Requirement: The grade-check mode setting

The setting roadmap.grade_check.mode MUST accept off, plan and on, and MUST default to plan.

Scenario: The default and a refused value

  • WHEN A config test loads the settings with no value set, and then with roadmap.grade_check.mode = "write"
  • THEN The value is plan by default, and the settings refuse write

Requirement: The step result line

The grade-check step SHALL write one result line with job=grade_check for each run.

Scenario: One run writes one line

  • WHEN The step runs once
  • THEN One result line with job=grade_check is written

Requirement: The daily CronWorkflow for each Service repository

An Argo CronWorkflow MUST run the grade-check step daily for each Service repository.

Scenario: The k8s manifests

  • WHEN The validator uv run devops ci --check --only k8s runs
  • THEN The check passes and shows the grade-check CronWorkflow

Requirement: The job success page states the held-grade rule

The job success page SHALL state the held-grade rule in place of the 80% rule.

Scenario: The docs test for the held-grade rule

  • WHEN The test uv run pytest tests/docs/test_docs.py -q runs
  • THEN The test passes and its assertion shows docs/roadmap/job-success.md names the held-grade rule and no 80% hold rule

Requirement: Pending a person after the merge

A person SHALL read 10 planned issues after 2 weeks in plan mode before the step runs in on.

Scenario: Two weeks of plan mode

  • WHEN The step has run in plan mode for 2 weeks
  • THEN A tracker comment lists the would-be issues, and a person reads 10 of them before on

Existing Tool Considered

The alternatives check of 2026-11-27 in the issue body returned none: no open, maintained tool covers the need. It lists the gaps. Alertmanager only routes alerts and cannot file or close a roadmap issue with intake labels. The change builds the step itself. The issue body gives the cost as about 350,000 tokens, 10 hours elapsed, and then 2 weeks in plan.

Key questions

  • Which caller runs the grade-check step each day?: The daily check runs devops roadmap step grade-check --repo <owner/repo> from an Argo CronWorkflow for each Service repository. (best practice) [sources: docs/guidelines/agentic-jobs.md, docs/roadmap/job-success.md]
    • Chosen: Argo CronWorkflow at the daily check. The guideline names a CronJob or CronWorkflow as the schedule of a job, and the job success page gives the daily check.
    • Rejected: A daily row of the Service due table. The Service rows carry the work of one item and write a last success. The grade check is repository maintenance.
  • Which hold rule replaces the 80% rule in docs/roadmap/job-success.md?: The held-grade rule. A workflow holds floor F when its p is F or more with 30 or more attempts at 3 daily checks in a row. It keeps F until the Wilson upper bound falls below F. The held grade is the highest floor that it holds. (best practice) [sources: docs/roadmap/job-success.md, docs/guidelines/agentic-jobs.md]
    • Chosen: Held grade with entry and exit. A floor with hysteresis stops a workflow at the 0.80 line from filing and closing an issue each day.
    • Rejected: Keep the plain 80% hold. It reads one day, so one bad day files an issue and the next good day closes it.
  • How does the step keep one issue for each workflow and repository?: By a hidden marker in the body: &lt;!-- devops-job-grade: v1 job=<job> repo=<repo> key=<sha256 of repo and job> grade=<g> classes=<sha256 of the top classes> -->. The create, edit and close path uses intake_candidate with filed_by="agent" and the fingerprint module of feat(roadmap): file, update and close finding issues by fingerprint #5153. The step sets no priority or milestone. (best practice) [sources: src/devops_cli/roadmap/intake/intake.py:1780, src/devops_cli/research/sweep.py, src/devops_cli/review/handoff.py]
    • Chosen: Hidden marker plus intake_candidate. intake_candidate is the one entry point for a new item, and the marker finds the issue on the next run.
    • Rejected: A search by title. The title holds the grade, so it changes at each drop.
  • What does roadmap.grade_check.mode do, and what is its default?: off sends no request. plan reads Loki and GitHub and logs each would-be create, edit and close, and sends no issue write. on writes. The default is plan, and --dry-run sends no request and returns the planned requests. (best practice) [sources: src/devops_cli/config/defaults.py:1273, src/devops_cli/config/settings.py, src/devops_cli/roadmap/steps/review.py, docs/guidelines/agentic-jobs.md]
    • Chosen: Default plan. A new writer shows its planned writes before it writes, as the guideline requires.
    • Rejected: Default on. It would file and close issues with no review.
  • Which source gives the daily ratios and the attempts?: The Loki result lines, with the base query of devops roadmap eval grades (RESULT_LINES in src/devops_cli/roadmap/job_grade_report.py). The step reads the 14 daily 7-day ratios and attempts of each workflow and repository. (best practice) [sources: docs/roadmap/job-success.md, src/devops_cli/roadmap/job_grade_report.py:130]
    • Chosen: Loki result lines with the grade report base. The result lines already hold the grade, the attempts and the counts. The step reuses one base query.
    • Rejected: The recorded series of child 7. Child 7 is not a dependency of this issue, and a new store adds work.
  • Does the step write its own result line?: Yes. It writes one result line with job=grade_check for each run. src/devops_cli/roadmap/job_result.py and docs/roadmap/job-success.md gain the name. (best practice) [sources: docs/roadmap/job-success.md, src/devops_cli/roadmap/job_result.py, CONTEXT.md]
    • Chosen: One result line with job=grade_check. The roadmap step frame writes one line for each run, so the dashboard counts the run.
    • Rejected: No result line. The run would be invisible to the dashboard and to eval grades.
  • Which issue title and body does the step write?: The title uses the type of the trigger: fix(<scope>): raise the <job> success from <p>% at grade <g>, test(<scope>): check the <job> measure at 100% first pass, or perf(<scope>): cut the <job> tokens for each success. The body holds the grade, n, the interval, the top 3 failure classes with counts and 3 sample items each, the owner action of the grade, and at 80 or better the efficiency measures. (best practice) [sources: docs/roadmap/job-success.md, docs/guidelines/agentic-jobs.md]
    • Chosen: One title for each trigger type. The type matches the owner action of the grade, and the body holds the facts that the action needs.
    • Rejected: One generic title for all triggers. A generic title hides the action and the grade from the list of issues.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#5165, #5168, #5153

Activity

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

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 12, 2026
  4. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: Multiple web searches for tools that monitor a metric, apply a statistical held-grade rule, and manage one GitHub issue per entity with fingerprint-based deduplication, body editing, and lifecycle (open/edit/close) returned no relevant open-source tool. The issue itself already considers and rejects Alertmanager because it cannot open a roadmap issue with intake labels nor close one, and no other tool in the searches covers the combined need of reading Loki series, computing a Wilson-bound held grade, and filing, editing, and closing a deduplicated GitHub issue per workflow.

    Tool: none found

    Lacks:

    • No open-source tool was found that reads a Loki time series, computes a statistical held grade (Wilson upper bound with a floor and consecutive-check rule), and manages one deduplicated GitHub issue per workflow with body editing and close-on-recovery.

    Searches run:

    • open source tool monitors metrics threshold and creates edits closes GitHub issues with fingerprint deduplication, results: 5
    • Prometheus Alertmanager GitHub issue creation webhook alert-to-issue tool, results: 5
    • "GitHub issue" alerting monitoring "file issue" OR "create issue" metric threshold open source tool, results: 5
    • Grafana alerting GitHub issue bot open source file close issue based on metrics, results: 5
    • github issue bot monitoring SLA success rate metric "open issue" "close issue" automation tool, results: 5
    • "alert-to-issue" OR "alert to github issue" open source deduplicate fingerprint, results: 5
    • alertmanager github issue integration file issue on alert, results: 5
    • open source "file GitHub issue" "monitoring" "success rate" automation bot deduplication, results: 5
    • github issue automation monitoring metric threshold "one issue per" deduplication fingerprint open source, results: 5
    • github issue bot alerting monitoring SLA success rate "open issue" "close issue" automation tool, results: 5

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

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

    @devops-cli-service
    Contributor

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

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

  7. added
    status/ready
    and removed
    status/new
    on Nov 29, 2026
  8. devops-cli-service commented on Nov 29, 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/highpriority/p2-mediumscope/roadmapsource/agentstatus/readytype/featurevalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions