Repository navigation
Description
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
pis 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 intojob-success.mdin place of the 80% rule. - Issues. One issue for each workflow and repository, through
intake_candidatewithfiled_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.
- File when the held grade drops, when the grade is
- Setting
roadmap.grade_check.mode(RowMode), defaultplan.offsends no request.planreads Loki and GitHub and logs each would-be create, edit and close.onwrites.--dry-runsends 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.
planmode makes 0 writes.--dry-runsends 0 requests.- After 2 weeks in
plan, a tracker comment lists the would-be issues, and a person reads 10 of them beforeon.
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
planmode 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-runsends 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
planby default, and the settings refusewrite
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_checkis 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 k8sruns - 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 -qruns - THEN The test passes and its assertion shows
docs/roadmap/job-success.mdnames 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
planmode 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:
<!-- 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 usesintake_candidatewithfiled_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_candidateis 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.
- Chosen: Hidden marker plus
- What does
roadmap.grade_check.modedo, and what is its default?:offsends no request.planreads Loki and GitHub and logs each would-be create, edit and close, and sends no issue write.onwrites. The default isplan, and--dry-runsends 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.
- Chosen: Default
- Which source gives the daily ratios and the attempts?: The Loki result lines, with the base query of
devops roadmap eval grades(RESULT_LINESinsrc/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_checkfor each run.src/devops_cli/roadmap/job_result.pyanddocs/roadmap/job-success.mdgain 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.
- Chosen: One result line with
- 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, orperf(<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.
Activity
dan-petty commentedon Nov 12, 2026
Both concern job grades for agentic workflows, but #5164 is the umbrella and the candidate is child 8 that adds the daily grade-check step to file, edit, and close one issue per workflow.devops-cli-service commentedon Nov 16, 2026
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:
Searches run:
Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
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.
devops-cli-service commentedon Nov 26, 2026
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.
devops-cli-service commentedon Nov 29, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.