Skip to content

feat(roadmap): refine reports an item that cannot be built #7266

Done

Description

@dan-petty

Problem or Motivation

Refine has no result for an item that cannot be built as written. The model then returns a proposal that fits one pull request and holds no acceptance criterion. Refine reads that as a failed form check (class=form_check, failed_1=acceptance_criteria), tries 3 times and leaves the item in New with refine.next_step=failed.

Result lines of 7 days (Loki, roadmap job result:, read 2026-11-26): 43 refine attempts have the class form_check, and each one names only acceptance_criteria. That is 43 of 95 failed attempts of refine with infra=false, and the count went from 2 on 2026-11-24 to 22 on 2026-11-25. The 25 items are not random:

So the empty list is a verdict of the model ("no criterion can be written for this item here"), and refine records it as a fault of the model. Each case costs up to 3 investigations, and the item gets no comment that tells a person why it stays in New. The record holds only "The reply of the model failed the form check: acceptance_criteria."

Proposed Solution

Disposition: change the code.

The reply of refine gets one more result for an item that cannot be built as written, with a reason and its evidence (a path, a command output or an issue number). For that result refine writes no proposal, posts one comment with the reason and the evidence, records the next step for a person, and does not try again until the body changes. The result line counts it as a result, not as a failure of class form_check.

Proof: a test with a scripted model: a reply with that result gives one comment, no retry and no form_check line. After the release, the 7-day count of form_check lines that name only acceptance_criteria goes down, and the items of the list above hold a reason.

Existing Tool Considered

None found. The change is in the output type of the refine agent and in the result handling of refine, which the project owns.

Related

Alternatives check of 2026-11-26: none.
Tool: none found.
Reason: Searches found only general agent frameworks, chiefly pydantic-ai, the project's own framework, which supplies typed outputs but no result handling, comment or retry policy; the need lives in project-owned refine code.

Lacks:

  • No result type for an item that cannot be built
  • No comment with reason and evidence for a person
  • No next-step record and no stop of the retries
  • No separate result line instead of a form_check failure

Proposed design

Problem statement

Refine cannot report an item that cannot be built as written. It records an empty acceptance_criteria list as a form_check failure. It retries three times and leaves the item in New with no comment for a person. The fix honors an open person question first, then accepts a cannot-build result with a reason and evidence.

Acceptance criteria

Requirement: Person question precedes missing criterion

Refine SHALL record an open (a person decides) question as a person wait even when the proposal has an empty acceptance_criteria list.

Scenario: Open person question with no criterion

  • WHEN A scripted model returns a proposal that fits one pull request. The proposal has an empty acceptance_criteria list and a key question marked (a person decides).
  • THEN The refine round posts the question comment. It records no form_check failure and no retry.

Requirement: Cannot-build result

Refine SHALL accept a reply that states the item cannot be built as written, with a reason and evidence, and SHALL write no proposal for that reply.

Scenario: Cannot-build reply

  • WHEN A scripted model returns the cannot-build result with a reason and evidence instead of a proposal.
  • THEN Refine posts one comment with the reason and evidence and records a person next step. It writes no proposal to the issue.

Requirement: No retry until the body changes

Refine SHALL not retry a cannot-build result until the issue body changes.

Scenario: Same body after cannot-build

  • WHEN The refine job runs again on the same issue body after a cannot-build result.
  • THEN It makes no model call and posts no second comment.

Requirement: Cannot-build result line

The result line of a cannot-build round MUST name the cannot-build result and MUST NOT name the class form_check.

Scenario: Result line of cannot-build round

  • WHEN A refine round ends with the cannot-build result.
  • THEN The result line holds no class=form_check and no failed_1=acceptance_criteria.

Requirement: Failed form-check record

A failed acceptance_criteria form check SHALL record the stop reason and the criterion count in its result line.

Scenario: Failed form-check with no saved reply

  • WHEN A refine round fails the form check on acceptance_criteria and the Service holds no model reply.
  • THEN The result line names the stop reason and the count of acceptance criteria.

Requirement: Pending a person after the merge

After the release, a person SHALL confirm the 7-day form_check count goes down and each listed item holds a reason.

Scenario: Post-release live proof

  • WHEN A person reads the Loki roadmap job result: lines for 7 days after the release.
  • THEN The count of form_check lines that name only acceptance_criteria is lower. Each listed item holds a comment with a reason.

Existing Tool Considered

The alternatives check of 2026-11-26 in the issue body found no open, maintained tool for this need. It records that pydantic-ai supplies typed outputs only. The proposal adds the missing result handling, comment and retry policy in project-owned refine code.

Key questions

  • Which path should refine use when a proposal has no acceptance criterion?: Honor an open `` question first. If no such question exists, accept a cannot-build result with a reason and evidence. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py, docs/ROADMAP_WORKFLOW.md:132, docs/roadmap/refine.md:128]
    • Rejected: Cannot-build result only. It leaves the existing person-question path unreachable for a proposal with no criterion.
    • Rejected: Person question only. It gives no result for an item that has no question and cannot be built.
    • Chosen: Person question first, then cannot-build result. It fixes the ordering defect and covers an item with no question.
  • How should refine represent the cannot-build result?: As a typed reply variant with a reason and evidence, separate from the proposal. (best practice) [sources: docs/roadmap/refine.md:128, docs/ROADMAP_WORKFLOW.md:238, src/devops_cli/roadmap/refine/refine.py]
    • Chosen: Typed reply variant. The reply schema can carry a reason and evidence and needs no proposal.
    • Rejected: Free-text sentinel in the proposal. It still fails the form check on the empty criterion list.
    • Rejected: Label-only stop. It gives no reason or evidence to a person.
  • Where does refine classify the failure?: _job_failure in src/devops_cli/roadmap/refine/refine.py classifies the failure. The result line uses the class from src/devops_cli/roadmap/failure.py. [sources: src/devops_cli/roadmap/refine/refine.py, src/devops_cli/roadmap/failure.py, docs/ROADMAP_WORKFLOW.md:238]
  • Does the failure record keep the model reply?: No. The record keeps the failed check names and the last error, not the reply. The builder reads the run records or traces for the failed replies. [sources: docs/ROADMAP_WORKFLOW.md:132, src/devops_cli/roadmap/refine/refine.py]
  • What must the builder read before the code change?: Read the failed replies of at least 5 of the 25 items from the run records or traces. Count the replies that hold a person question. If the records hold no reply, first add the stop reason and criterion count to the result line. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:132, docs/roadmap/refine.md:144, src/devops_cli/roadmap/refine/refine.py]
    • Chosen: Read the failed replies first. The Service keeps no reply, so the count shows which path handles most cases.
    • Rejected: Change the code without the count. The cause is a hypothesis and the count is missing.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/feature
    source/agent
    scope/roadmap
    on Nov 26, 2026
  2. dan-petty commented on Nov 26, 2026

    @dan-petty
    OwnerAuthor
    • Related: fix(roadmap): Name the failed refine form check to the model #6327, which asks for a different change. Both handle the acceptance_criteria form check in refine, but dan-petty/devops-cli#6327 names the failed check to help the model retry, while this item adds a new result type that stops retrying and posts a reason to a person.
  3. added
    status/new
    value/medium
    effort/medium
    priority/p2-medium
    on Nov 26, 2026
  4. dan-petty commented on Nov 26, 2026

    @dan-petty
    OwnerAuthor

    Code facts for the design of this item, from src/devops_cli/roadmap/refine/refine.py at main of 2026-11-26:

    • refine_one_item calls _job_failure before next_step_of. _job_failure counts an empty acceptance_criteria list of a proposal that fits one pull request as a failed form check, also when the proposal holds a question that ends with (a person decides).
    • next_step_of documents another order: the open questions go to a person first, and a failed form check is last. The early return of _job_failure makes that order unreachable for a proposal with no criterion.
    • So a reply that says "a person must decide, and I can write no criterion" is recorded as form_check and tried again, 3 times, and the question never reaches the person.
    • The record of a failed round keeps only the text "The reply of the model failed the form check: acceptance_criteria." It keeps no reply of the model.

    First step for the builder: read the failed replies of 5 or more of the 25 items from the run records or the traces, and count how many hold a question for a person. That count decides the form of the change:

    • Most replies hold such a question: let the question win over the missing criterion in _job_failure. This uses the person path that exists and adds no result type.
    • Most replies hold no question: add the result that the body of this item proposes, with a reason and its evidence.

    Do not change the first request of refine for this: the job holds 94%, and a change that only acts on a reply with no criterion cannot lower that ratio.

  5. dan-petty commented on Nov 26, 2026

    @dan-petty
    OwnerAuthor

    Correction to the body of this item: it states the cause as a fact ("the empty list is a verdict of the model"). That is a hypothesis.

    What the data proves:

    • 43 refine attempts of 7 days have the class form_check, each with failed_1=acceptance_criteria only, on 25 items.
    • The items show the pattern of the list in the body (work that moved, person-only steps, blocked or returned items).

    What it does not prove:

    • The Service keeps no reply of the model for a failed round, and its log holds only the result line. For 6 failures outside the provider cut of 2026-11-25 that I read in Loki, no line about a stopped investigation, a model call or a limit comes before the result line.
    • 5 of the 43 lines are inside the cut (13:12Z to 20:43Z), where model calls failed. For those, a stopped investigation that left a draft with no criterion is as likely as a verdict.

    So the first task stays as the comment above says: read the failed replies from the run records or the traces, and count the causes, before any change to _job_failure or to the reply type. If the records hold no reply, the first change is to keep the stop reason of the investigation and the count of criteria in the result line of a failed round.

  6. devops-cli-service commented on Nov 26, 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 (7)

    Tools considered:

    Searches run:

    • open source AI agent triage library judges whether an issue is feasible before implementation, results: 5
    • pydantic-ai structured output union result type "cannot be done" abstain outcome, results: 5
    • GitHub issue triage agent open source marks issue "not actionable" with reason comment, results: 5
    • "needs human" escalation pattern AI agent output schema reason evidence open source framework, results: 5
    • issue triage agent github open source, results: 5
    • pydantic-ai, results: 5
    • "multiple output types" agent union output abstain no retry, results: 5

    Sources:

  7. added
    status/ready
    and removed
    status/new
    on Nov 28, 2026
  8. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  9. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 29, 2026
  10. removed
    status/in-review
    on Nov 29, 2026
  11. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 20:59 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