Skip to content

feat(roadmap): eval grades prints the grade of each workflow #5165

Closed

Description

@dan-petty

Part of #5164 (child 1, the first child).

Problem or Motivation

The owner asked on 2026-11-12 for a grade of each agentic workflow from its measured success, with one action for each grade (the table is in #5164). The roadmap jobs already write one result line for each attempt to Loki (docs/roadmap/job-success.md). No command reads the lines and says how each workflow performs. A person or an agent must write LogQL to see a ratio, and the dashboard row Roadmap Job Success shows only the 80% line.

Proposed Solution & Architectural Design

Add devops roadmap eval grades. The eval group scores a job on a golden set; this command scores it on its live result lines.

  • Options: --repo (default: all), --window 6h|24h|7d (default 7d), --format table|json, --loki-url (else the loki.url setting), --dry-run (0 requests; returns the planned queries).
  • Read Loki with metric instant queries (/loki/api/v1/query, count_over_time and quantile_over_time ... | unwrap), not log lines, so no line limit applies. Reuse k8s/logql.py (resolve_loki_url, the private egress client).
  • For each workflow and repository: n, successes, p on attempts with infra=false, the Wilson 95% interval (statsmodels.stats.proportion.proportion_confint(method="wilson")), the point grade and the grade range of the interval, the all-attempts ratio, the infrastructure share, the first-pass ratio (stage: plan_calls ≤ 1, gate_returns = 0, verify_rounds ≤ 1; implement: repair_rounds = 0; fix_plan: gate_returns = 0, verify_rounds ≤ 1, after = 0; other jobs: n/a until child 3), the top 3 failure classes with counts, the grade action, and a row for each version with 10 or more attempts.
  • Efficiency, for jobs with tokens and seconds: median, p90 and max of tokens and seconds for each attempt; tokens and seconds for each success (sum of all attempts / successes). Show them at every grade. Mark them "optimize" at grade 80 or better, else "report only".
  • Grade rules: too few under 30 attempts; 100 when every attempt is first-pass; else the floor of p (0.90, 0.80, 0.70, 0.60, under 0.60). Put the table (floor, name, action, efficiency flag) in one module, roadmap/job_grade.py.
  • The docs generator writes the table into docs/roadmap/job-success.md. The section "The 80% rule" becomes "The job grades". The held-grade rule comes with child 8. Add the term "job grade" to CONTEXT.md and say that it is not a decision-point band.
  • --format json is for agents and the hourly shepherd: one object for each workflow and repository, with the fields above.

Target Subsystem

SDLC, Git & PR Governance (src/devops_cli/roadmap/, src/devops_cli/commands/roadmap_eval*.py).

Existing Tool Considered

Grafana Explore and the dashboard row show a ratio, but no grade, interval, action or efficiency, and an agent cannot read them as JSON. statsmodels (a current dependency) gives the Wilson interval; the custom code is the grade table and the report. Cost: about 300,000 tokens to build, 6 hours elapsed; keep about 20,000 tokens a month.

Acceptance Criteria

  • On recorded Loki replies (fixture), the report gives n, p, the interval, the grade, the top classes and the efficiency measures, and they equal a hand count.
  • 22 of 25 attempts give p 0.88, interval [0.70, 0.96], grade 80, range 70 to 90.
  • 29 attempts give too few. 30 first-pass attempts of 30 give 100.
  • An attempt with infra=true changes the infrastructure share and not p.
  • --dry-run sends 0 requests and prints the queries.
  • devops docs check passes with the new table in job-success.md.

Dependencies

None.

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    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. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 12, 2026
  5. removed
    status/in-review
    owner/agent
    on Nov 12, 2026
  6. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-12 19:05 UTC

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