Skip to content

feat(roadmap): track job grades for each agentic workflow #5164

Open
8 of 15 issues completed
Open

Description

@dan-petty

Update 2026-11-26 (infra move): product alert rules and dashboards are in k8s/devops/. Loki, Prometheus and Grafana are configured in k8s/logging/ and k8s/monitoring/ of dan-petty/homelab, so a child that needs a Loki ruler or remote write needs an issue there.


Problem or Motivation

The owner wrote on 2026-11-12, word for word:

Agentic workflows and functionalities should have evaluation capabilities and metrics that allow actual performance evaluation. These aren't hard numbers and I would like to have dynamic gaugesin the long term tuned to project performance history, but it should be something like:

  • 100% success with no fix rounds - Evaluate for measurement issues or bugs, look at opportunities to tighten gates, restrictions, and correction suggestions
  • 90% success rate - Well performing workflow, apply routine updates and refinements, prioritize new features
  • 80% success rate - Acceptable performance, could use improvement. Check for leading failure modes and prioritize fixes and fixer jobs that would increase success rate
  • 70% success rate - Degraded performance. Focused effort on identifying leading causes of failure with high prioritization
  • 60% success rate - Ineffective. Look for implementation alternatives or serious issues that could be fixed to get this working
  • Under 60% success rate - Basically a coin flip at this point, re-architecting is required

The owner added the same day, word for word:

above 80% success we can also look at cost, time, and token efficiency

one more consideration to make with agentic workflows is the model tier, so jobs that frequently succeed at a small context window would be good candidates to test running with a local model and tasks that are failing could be good candidates to run with a frontier model

monitoring tool call errors could give an early indicator of what is causing job failures

can we make the tools a bit more flexible to support common use cases? That should be part of the project self-improvement loop

Facts on 2026-11-12 (Loki, about 17:25Z):

  • 7 roadmap jobs write one result line for each attempt (roadmap/job_result.py, docs/roadmap/job-success.md). The line went live at about 12:58Z, so Loki holds about 4.4 hours of lines from 4 versions.
  • job-success.md has one rule, "the 80% rule". No workflow has a grade, an action for its grade, a first-pass measure or an efficiency measure.
  • Measure defect. Intake logged 29 skipped lines with the class head_moved as failures. The code says that this case "is no failure". Intake shows 0.56 as logged and 1.00 without these lines.
  • Measure defect. A staged stage item (refactor(ai): rank the benchmark with numpy and pytrec-eval #1928) has plan_calls=0 with 2.1M tokens.
  • Missing lines. devops review, Jev decisions and retitle write no line. The fix-plan Job on fix(github): Fix check-readiness base and monitor merged state #4980 used 15.9M tokens in 3,272 s, ended unchanged with 1 open finding before and 2 after, and wrote no line to Loki: the line is an INFO record, and only the Service log holds INFO.
  • refine_judge, alternatives and fix_plan have 0 lines in 7 days.

Goal

Each agentic workflow has a job grade from its measured success: 100, 90, 80, 70, 60 or <60. Each grade has the owner action. A drop of a grade becomes one roadmap issue for that workflow. At grade 80 or better, the action also covers cost, time and tokens for each success.

Decisions

  • The term is "job grade". ADR 0019 and CONTEXT.md use "band" for the answer of a decision point.
  • One source. The result line in Loki stays the source. It gets first_pass= and the counts model_calls, tokens, seconds, cost_usd_micros and gh_requests.
  • Grade rules. Ratio p = successes / attempts with infra=false, 7 days. A grade needs 30 or more attempts, else too few. The report shows the Wilson 95% interval (statsmodels proportion_confint, a current dependency). The held grade generalizes the 80% rule to each floor: 3 daily checks in a row at the floor to hold it, a Wilson upper bound under the floor to lose it.
  • Infrastructure cuts are apart. One gateway outage must not give every workflow the action "re-architect". The infrastructure share has its own alert.
  • Windows. 7 d for the grade, 24 h for the trend, 6 h for a broken workflow. A table for each version with 10 or more attempts.
  • Efficiency (owner, 2026-11-12). For each workflow, repository and version: tokens for each attempt (median, p90, max), and tokens, seconds, model calls, cost (hosted spend from the spend ledger; a local model shows tokens only, fix(ai): an agent run on a hosted group is not local spend #3665) and GitHub requests for each success (sum of all attempts / successes). At grade 80 or better the grade action includes efficiency work. Under 80 the report shows these measures and the work goes to success first. A rise for each success after a version is a signal. The targets come from the history of each workflow (feat(monitoring): grade limits and efficiency targets from history #5174), not from fixed numbers.
  • Grade table:
Grade Rule Action Efficiency work
100 every attempt has first_pass=true Check the measure for defects or bugs. Tighten gates, restrictions and correction suggestions. yes
90 p ≥ 0.90 Routine updates and refinements. New features first. yes
80 0.80 ≤ p < 0.90 Find the leading failure modes. Fixes and fixer jobs first. yes
70 0.70 ≤ p < 0.80 Find the leading causes of failure, with high priority. report only
60 0.60 ≤ p < 0.70 Look for implementation alternatives or serious defects. report only
<60 p < 0.60 Re-architect the workflow. report only
  • Model tier (owner, 2026-11-12). The line names the model that answered and the input tokens for each request. A workflow at held grade 90 or better whose p90 context fits half of a local tier window is a local candidate. A workflow under 80 whose failures are half or more model-capability classes (plan_defect, test, lint, types, no_change_in_fix, tests_lost, outside_plan, parser) is a frontier candidate. A move is a trial on a share of the attempts (or in shadow, the intake Jev pattern) with a revert rule, then a settings pull request that a person merges. Frontier trials use the owner set (Sonnet, DeepSeek). A Sonnet trial waits for the owner to lift the hold of 2026-11-11.
  • Tool call errors (owner, 2026-11-12) are a leading signal. One counter for every workflow (devops_cli_roadmap_tool_calls_total with a new error_class label) and tool_errors and tool_error_top on the result line. The report links the top failing tools to the failure classes of the same attempts.
  • Flexible tools in the self-improvement loop (owner, 2026-11-12). A refused call gets a safe key (tool, program name from a known list or other, refusal reason). The loop ranks the keys with the rules of feat(telemetry): rank CLI usage errors and propose fixes #4840 and proposes a change (allowlist, narrow tool, split, hint) at 10 or more refusals on 3 or more days in 3 or more items. Each allowlist change gets a security review. A trial then checks that refusals fall and that success and first pass do not fall.
  • Rejected: a Prometheus counter in place of the line (the reason is in job-success.md); Grafana-managed recording rules (not in git, no promtool); Sloth SLOs for each job (feat(monitoring): define the Service SLOs in a Sloth spec #4709 keeps the Service SLOs; tens of attempts a day are too few for burn windows); an LLM evaluation platform such as Langfuse or Arize Phoenix (a second store, prompt text stays off, Phoenix is ELv2).

Ordered child list

Each line gives the issue, its child number and the issues to merge first.

  1. feat(roadmap): eval grades prints the grade of each workflow #5165 devops roadmap eval grades prints the grade of each workflow (first). Needs none.
  2. fix(roadmap): leave out changed intake candidates and count plan calls #5166 fix: the result line leaves out a changed intake candidate and counts stage plan calls. Needs none.
  3. feat(roadmap): result lines state first-pass, model calls and cost #5168 each result line states first-pass, model calls, tokens, seconds, cost and GitHub requests. Needs fix(roadmap): leave out changed intake candidates and count plan calls #5166.
  4. fix(roadmap): a Job pod and a local run log the job result line #5169 fix: a Job pod and a local run send the result line to Loki. Needs none.
  5. feat(review): each review session writes a job result line #5170 each devops review session writes a result line. Needs feat(roadmap): result lines state first-pass, model calls and cost #5168, fix(roadmap): a Job pod and a local run log the job result line #5169.
  6. feat(ai): each Jev decision writes a job result line #5171 each Jev decision writes a result line. Needs feat(roadmap): result lines state first-pass, model calls and cost #5168, fix(roadmap): a Job pod and a local run log the job result line #5169.
  7. feat(monitoring): record job grades from result lines in Prometheus #5172 Loki ruler and Prometheus recording rules for the grades. Needs feat(roadmap): result lines state first-pass, model calls and cost #5168, fix(roadmap): a Job pod and a local run log the job result line #5169.
  8. feat(roadmap): a daily grade-check step keeps one issue per workflow #5173 a daily grade-check step keeps one issue for each workflow. Needs feat(roadmap): eval grades prints the grade of each workflow #5165, feat(roadmap): result lines state first-pass, model calls and cost #5168, feat(roadmap): file, update and close finding issues by fingerprint #5153.
  9. feat(monitoring): grade limits and efficiency targets from history #5174 grade limits and efficiency targets from history (long term). Needs feat(monitoring): record job grades from result lines in Prometheus #5172, feat(roadmap): a daily grade-check step keeps one issue per workflow #5173, 28 days of lines.
  10. feat(roadmap): find a success or efficiency change after a release #5175 a success or efficiency change after a release (long term). Needs feat(roadmap): eval grades prints the grade of each workflow #5165, feat(roadmap): result lines state first-pass, model calls and cost #5168.
  11. feat(roadmap): eval grades shows success and context size per model #5176 eval grades shows success and context size for each model, and a tier recommendation. Needs feat(roadmap): eval grades prints the grade of each workflow #5165, feat(roadmap): result lines state first-pass, model calls and cost #5168.
  12. feat(roadmap): trial a model tier on a share of a job's attempts #5177 trial a model tier on a share of the attempts (or in shadow), with a revert rule. Needs feat(roadmap): eval grades shows success and context size per model #5176, feat(roadmap): find a success or efficiency change after a release #5175.
  13. feat(roadmap): count tool call errors by class for each workflow #5179 count tool call errors by class for each workflow, as a leading signal. Needs feat(roadmap): eval grades prints the grade of each workflow #5165, feat(roadmap): result lines state first-pass, model calls and cost #5168.
  14. feat(roadmap): rank refused tool calls and propose safe tool changes #5180 rank refused tool calls and propose safe tool changes, in the self-improvement loop (links feat(telemetry): rank CLI usage errors and propose fixes #4840). Needs feat(roadmap): count tool call errors by class for each workflow #5179, feat(telemetry): rank CLI usage errors and propose fixes #4840, feat(roadmap): file, update and close finding issues by fingerprint #5153, feat(roadmap): find a success or efficiency change after a release #5175.

Then #3655 (gauges and alerts) after #5172.

Folded into existing items (scope comments, not children)

Measure of the whole

Measure Today Target
Agentic workflows with a result line 7 10 here, and each new workflow of #5014, #5120 and #5151
Runs whose line reaches Loki Service only Service, Job pods and local runs
Workflows with a first-pass measure 0 all with a line
Workflows with efficiency measures for each success 0 all with a line
Known measure defects 2 0
Grade drop to roadmap issue none 1 issue for each workflow, by fingerprint

Target Subsystem

SDLC, Git & PR Governance (src/devops_cli/roadmap/), AI & Agentic Review Pipeline (src/devops_cli/review/, src/devops_cli/ai/), and monitoring (k8s/devops/monitoring/, k8s/devops/dashboards/; Loki and Prometheus setup in dan-petty/homelab).

Existing Tool Considered

Loki ruler recording rules with remote write to Prometheus, Prometheus rules with promtool tests, Grafana dashboards as code, statsmodels for the Wilson interval and the two-sample test, SciPy for the Mann-Whitney U test, and the fingerprint issue module of #5153. Custom code: the grade table and the report (about 300 lines), the attempt context (about 150 lines), the grade-check step (about 250 lines). Each child gives its cost. Total about 2.4M tokens and 56 hours, then 2 weeks of plan mode and 28 days of history for child 9.

Acceptance Criteria

  • Each child is merged, or closed with evidence.
  • devops roadmap eval grades shows a grade or too few for each workflow with a line.
  • The measures of the whole meet their targets.

Dependencies

None for the tracker. The children carry their own.

Alternatives check of 2026-11-28: partly.
Tool: langfuse/langfuse (https://github.com/langfuse/langfuse), NOASSERTION, last activity 2026-11-28, maintained.
Reason: Search found Langfuse, an open agent observability and eval platform: it covers traces, cost and token metrics and evaluators, but not grade bands, owner actions or roadmap issues, and the issue itself rejects a second store.

Covers:

  • Traces agent actions and tool calls, built on OpenTelemetry
  • Cost, latency and token metrics with custom dashboards and alerts
  • Code and LLM-as-judge evaluators, datasets and experiments
  • Metrics and query API for bespoke reports

Lacks:

  • No job grade bands with an owner action for each grade
  • No roadmap issue on a grade drop, no fingerprint dedupe
  • Second store: traces and prompts leave Loki and the cluster
  • No local or frontier model-tier recommendation from context size

Sub-issues

Sub-issues

8 of 15 Issues completed
Loading 15 sub-issues

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. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    The command gate plan (tracker #5199) adds two grade inputs to this item. Today the grades do not show the cost of refusals, so nobody can judge a list change against the grade of a workflow.

    New inputs:

    • Gate refusals for each 100 tool calls.
    • The share of refused rest parts that shadow Jev would run (the over-blocking cost).

    Show the top gate rules of a workflow with a grade under 80.

    The counts come from #5179, after its update (comment on #5179), and from the shadow records of #5206.

    Acceptance to add: a fixture with 10 refusals in 200 calls and 4 would-run answers out of 8 shows 5.0 and 50 % in the grade report.

    Dependencies: #5179.

  5. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    Data point for the grades of this tracker: one implement run wrote two result lines. On 2026-11-13 at 02:13:42Z and 02:13:50Z the Service wrote job=implement item=#4697 result=ready seconds=3016 twice, with different trace IDs. The first line has tokens=13545198, the second has tokens=0. A count of lines gives 2 successes for 1 run. In 7 days of Loki this is the only implement line with tokens=0. A grade query should count one result for each item and run (for example, the line with the highest token count), or the writer should write the line once.

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

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (6)

    Tools considered:

    Searches run:

    • Opik LLM evaluation observability open source, results: 5
    • open source LLM agent observability evaluation platform self-hosted cost tokens success rate, results: 5
    • MLflow LLM evaluation tracing metrics cost open source, results: 5
    • measure AI agent workflow success rate first pass cost per task evaluation open source tool, results: 5
    • Opik docs track token cost per trace evaluation scores dashboards, results: 5
    • open source tool grade agent workflows success rate regression alert issue creation, results: 5

    Sources:

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

    @devops-cli-service
    Contributor

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

    Searches (7)

    Tools considered:

    Searches run:

    • Langfuse agent metrics token cost tool call errors evaluation scores, results: 5
    • open source LLM agent workflow evaluation and observability platform success rate cost tokens, results: 5
    • Arize Phoenix LLM evaluation open source license, results: 5
    • Langfuse, results: 5
    • MLflow GenAI evaluate LLM agent tracing metrics open source, results: 5
    • promptfoo agent evaluation CI metrics, results: 5
    • Langfuse metrics API custom dashboards documentation, results: 5

    Sources:

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/newtype/featurevalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions