Skip to content

fix(roadmap): grade the refine judge by verdicts that hold #5905

Done

Description

@dan-petty

Problem

The grade of the job refine_judge counts each refusal as a failure. docs/roadmap/job-success.md:33 gives approved as the only intended result. But the judge reviews the refine proposal for an item that a bot opened, and a correct refusal of a bad proposal is the intended result of a judge.

On 2026-11-16 the 7-day grade was 6/11 (54%). Of the 5 refusals:

Since 2026-11-13 17:37Z the judge approved 5 of 5. So the 54% shows old, correct refusals, not a defect of the judge. A judge that refuses each bad proposal can never reach 80%, and a judge that approves each proposal gets 100%.

Expected behavior

The grade of a judge counts a verdict that holds as a success, from data that a program reads (no model grades the judge):

  • An approval holds when the item reaches a plan that builds, or a person keeps the proposal.
  • A refusal holds when a person returns or changes the item, or a later proposal with changes is approved.
  • A verdict with no outcome yet is open, and the grade leaves it out.

Keep the count of approvals and refusals in the report, so the refusal rate stays visible.

Related

Alternatives check of 2026-11-23: none.
Tool: none found.
Reason: Searches found only generic LLM-eval frameworks, promptfoo and Inspect, which score their own test cases; neither reads roadmap job records or GitHub label events to resolve a verdict, so no tool covers this grade change.

Lacks:

  • No join of a verdict to later roadmap records of its item
  • No reading of stage plan results or status/planned label events
  • No open-verdict exclusion or approval/refusal counts in a report
  • Needs verdicts exported to its own test-case files

Proposed design

Problem statement

The refine_judge grade counts each refusal as a failure, so correct refusals lower the grade. The grade must resolve each verdict to held, not_held or open from later roadmap records, with no model call. It must keep the approval and refusal counts visible. The plan-build confirmation is deferred to a follow-up issue that waits on #5603.

Acceptance criteria

Requirement: Body hash on judge verdict

The refine_judge result line SHALL record the body_hash of the proposal that the judge reviewed.

Scenario: Judge result line holds body hash

  • WHEN a test builds the refine_judge result line for a proposal body
  • THEN the result line holds body_hash equal to the SHA-256 of the proposal body

Requirement: Outcome resolution from records

The job grade report SHALL resolve each refine_judge verdict in the window to held, not_held or open from the later roadmap records of its item.

Scenario: Verdict with no later record

  • WHEN a refine_judge verdict for item 5905 has no later roadmap record of item 5905
  • THEN the report marks the verdict open

Requirement: Approval held by planned label

The report SHALL mark an approved verdict held when a status/planned label event of the same item follows the verdict.

Scenario: Planned label after approval

  • WHEN an approved verdict for item 5905 precedes a status/planned label event of item 5905
  • THEN the report marks the approved verdict held

Requirement: Approval not held by return or change

The report SHALL mark an approved verdict not_held when a later status/new label event or a different-body refusal follows it before a status/planned event.

Scenario: Return after approval

  • WHEN an approved verdict for item 5905 with body hash H precedes a status/new label event of item 5905 and no status/planned event
  • THEN the report marks the approved verdict not_held

Requirement: Refusal held by return

The report SHALL mark a refused verdict held when a status/new label event of the same item follows the verdict.

Scenario: Person returns the item

  • WHEN a refused verdict for item 5905 precedes a status/new label event of item 5905
  • THEN the report marks the refused verdict held

Requirement: Refusal held by later approval

The report SHALL mark a refused verdict held when a later refine_judge approval of the same item has a different body hash.

Scenario: Later changed proposal is approved

  • WHEN a refused verdict for item 5905 with body hash H precedes an approved verdict for item 5905 with body hash H2
  • THEN the report marks the first refused verdict held

Requirement: Refusal not held by same proposal

The report SHALL mark a refused verdict not_held when a later refine_judge approval of the same item has the same body hash.

Scenario: Same proposal is approved later

  • WHEN a refused verdict for item 5905 with body hash H precedes an approved verdict for item 5905 with body hash H
  • THEN the report marks the refused verdict not_held

Requirement: Held verdicts set the ratio

The report SHALL count each held verdict in the numerator of the refine_judge success ratio.

Scenario: Two held of three closed

  • WHEN the window holds two held verdicts and one not_held verdict
  • THEN the refine_judge success ratio is 2/3

Requirement: Open verdicts leave the ratio

The report SHALL leave each open verdict out of the refine_judge success ratio.

Scenario: Two open verdicts

  • WHEN the window holds one held verdict, one not_held verdict and two open verdicts
  • THEN the refine_judge success ratio is 1/2

Requirement: Approval and refusal counts

The report SHALL show the count of approved verdicts and the count of refused verdicts of refine_judge beside the verdict score.

Scenario: Counts in the report

  • WHEN the window holds three approved and two refused verdicts
  • THEN the report shows approved=3 and refused=2

Requirement: No model in outcome resolution

The job grade report SHALL resolve each verdict with no model call.

Scenario: Resolver runs with no model

  • WHEN a test runs the outcome resolver on a fixed result-line set
  • THEN the resolver makes no model call and returns the fixed outcomes

Requirement: Job success page row

The refine_judge row of docs/roadmap/job-success.md SHALL name a verdict that holds as the intended result.

Scenario: Docs test reads the row

  • WHEN a test reads the refine_judge row of docs/roadmap/job-success.md
  • THEN the intended result column names a held verdict

Existing Tool Considered

The alternatives check of 2026-11-23 in the issue body gives the verdict none and names no tool. It lists the gaps in its Lacks list. The proposal fills them in the job grade report with the result lines and one new label-event read. Written cost: about 50,000 tokens to build, about 8,000 tokens a month to keep and fix, and about 2 days of elapsed time.

Key questions

  • Which data confirms that a refine_judge verdict holds?: A later status/planned label event holds an approval. A later status/new label event or a later refine_judge approval with a different body hash holds a refusal. A later status/new event or a different-body refusal before any status/planned event marks an approval not_held. A later approval with the same body hash marks a refusal not_held. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, docs/roadmap/job-success.md:33, src/devops_cli/roadmap/refine/refine_judge.py:99-105, src/devops_cli/roadmap/job_grade_report.py:370-406]
    • Chosen: Later label events and judge verdicts. The transition table records status/planned and status/new, and the judge result line records the verdict and body hash.
    • Rejected: GitHub issue state alone. The current state cannot show which event followed a verdict.
    • Rejected: A model grades the judge. The issue forbids a model in the grade.
  • How does the report get the body hash of a judge verdict?: The refine_judge result line records body_hash of the proposal. The report reads it from the result line and adds no GitHub read for the hash. (best practice) [sources: src/devops_cli/roadmap/refine/refine_judge.py:99-105, src/devops_cli/roadmap/job_result.py]
    • Chosen: Add body_hash to the result line. The report already reads result lines, so the hash needs no extra read.
    • Rejected: Read refine.body_hash from each issue record. The report does not read issue records now, and this adds one GitHub read for each item.
    • Rejected: Use no body hash. The report cannot tell a changed proposal from the same proposal.
  • How does the report read the label events of an item?: The report adds one GitHub GraphQL read of the issue timeline for each item in the window. It reads the status/planned and status/new label events. It keeps the existing bot pull request search. (best practice) [sources: src/devops_cli/roadmap/job_grade_report.py:370-406, docs/ROADMAP_WORKFLOW.md]
    • Chosen: Issue timeline label events. The transition table records each status change as a label event.
    • Rejected: Issue body job record. The record holds the current status and no time for each status change.
    • Rejected: Aggregate LogQL only. Label events are not in the result lines.
  • How does the report treat a verdict with no outcome yet?: It marks the verdict open and leaves it out of the success ratio. The ratio uses held and not_held verdicts only. (best practice) [sources: docs/roadmap/job-success.md, src/devops_cli/roadmap/job_grade_report.py:370-406]
    • Chosen: Leave the open verdict out. The issue states that the grade leaves a verdict with no outcome out.
    • Rejected: Count the open verdict as a failure. It lowers the grade before the outcome is known.
    • Rejected: Count the open verdict as a success. It hides a judge that refuses a good proposal.
  • Where does the report keep the approval and refusal counts?: It keeps them in the same workflow object as the verdict score, as approved and refused counts. (best practice) [sources: docs/roadmap/job-success.md, src/devops_cli/roadmap/job_grade_report.py:370-406]
    • Chosen: Beside the verdict score. The report already gives the verdict score beside the attempt ratio.
    • Rejected: In a separate report. The issue keeps the counts in the same report.
  • Does an open verdict count as an attempt for the too few rule?: Yes. The verdict is the result of one judge attempt, so the report counts it as an attempt. It leaves the verdict out of the success ratio only. (best practice) [sources: docs/roadmap/job-success.md]
    • Chosen: Count the open verdict as an attempt. The grade reads the attempts of the job, and the verdict is the result of one attempt.
    • Rejected: Do not count the open verdict as an attempt. It hides the work that the judge did in the window.
  • Does a held refusal change the first-pass rule of refine_judge?: No. The first-pass rule reads round = 1 and findings = 0, not the verdict. [sources: docs/roadmap/job-success.md:90, src/devops_cli/roadmap/job_result.py]
  • How does the job success page get the new intended result?: The pull request edits the hand-written refine_judge row of docs/roadmap/job-success.md. A test in tests/docs/test_docs_inventory.py asserts that the row names a held verdict. The report adds no generator for the workflow table. (best practice) [sources: docs/roadmap/job-success.md:28-39, src/devops_cli/roadmap/job_grade.py:251, tests/docs/test_docs_inventory.py:152-153]
    • Chosen: Edit the hand-written row and test it. sync_grade_table writes only the JOB_GRADES markers, and a generator is a larger change.
    • Rejected: Add a generator for the workflow table. The table is hand-written and a generator is outside this grade change.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Moved to new items

#7166

Activity

  1. added
    type/bug
    source/agent
    scope/roadmap
    status/new
    value/medium
    on Nov 16, 2026
  2. dan-petty commented on Nov 16, 2026

    @dan-petty
    OwnerAuthor
  3. added
    effort/medium
    priority/p2-medium
    on Nov 16, 2026
  4. devops-cli-service commented on Nov 17, 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 (10)

    Tools considered:

    Searches run:

    • open source tool grade LLM judge verdicts against downstream outcomes, results: 5
    • evaluate LLM-as-judge accuracy with outcome labels tool library, results: 5
    • promptfoo LLM judge evaluation ground truth labels, results: 5
    • Langfuse scores human feedback judge evaluation open source, results: 5
    • Inspect AI scorers evaluate agent judge outcome, results: 5
    • promptfoo github, results: 5
    • DeepEval LLM evaluation framework, results: 5
    • Arize Phoenix open source LLM evaluation annotations, results: 5
    • promptfoo, results: 5
    • Langfuse, results: 5

    Sources:

  5. added
    status/ready
    and removed
    status/new
    on Nov 18, 2026
  6. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 86358b6 (see proposed design in issue body).

  7. added
    owner/agent
    on Nov 25, 2026
  8. dan-petty commented on Nov 25, 2026

    @dan-petty
    OwnerAuthor

    Returning #5905 because the proposed design cannot be built against the current codebase as written:

    1. No body_hash or stage plan-check field exists on result lines: refine_judge logs only round and findings (src/devops_cli/roadmap/refine/refine_judge.py:99-105), and stage logs result, plan_calls, gate_returns, verify_rounds, tokens, seconds (src/devops_cli/roadmap/stage/stage.py:4731-4738, docs/roadmap/job-success.md:30-33), while dependency feat(roadmap): grade stage by the plans that build #5603 is still open and not implemented on main.
    2. job_grade_report.py runs aggregate LogQL metric instant queries (sum by ... in _query_expr, src/devops_cli/roadmap/job_grade_report.py:370-406) and bot PR GraphQL searches, not per-item timestamped result joins, issue status/planned label event reads, or stage-return reads.
    3. No generator exists for the refine_judge intended-result row referenced in the scenario: sync_grade_table (src/devops_cli/roadmap/job_grade.py:251) writes only <!-- JOB_GRADES_START -->..<!-- JOB_GRADES_END -->, and the workflow table in docs/roadmap/job-success.md:28-39 is hand-written (tests/docs/test_docs_inventory.py:152-153).
    4. The requirements assume three outcomes (held, does not hold, and open), but do not specify what conditions mark an approved or refused verdict as does not hold rather than open.
  9. added
    status/new
    and removed
    status/ready
    owner/agent
    on Nov 25, 2026
  10. added
    status/ready
    and removed
    status/new
    on Nov 25, 2026
  11. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

  12. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 29, 2026
  13. removed
    status/in-review
    owner/agent
    on Nov 29, 2026
  14. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 16:17 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/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions