Repository navigation
Description
Split from #3215.
Problem: The stage and implement jobs stop an item when build_body or build_plan_body refuses a title or body. The issue asks the job to send the problems to the model once and to stop only on a second refusal. Why deferred: The implement job has no free-text model step for the pull request body. The stage job has no body retry path. A retry needs a new prompt, a new bounded step and tests. The safe stop is in this item, and the retry is a separate change. Acceptance criteria: A job that gets a refused body sends the problems to the model once. A rebuilt body that passes is written to the pull request. A second refusal stops the item with the refused-reply failure class. The job writes no ... into a title or body.
Proposed design
Problem statement
The stage job and the implement job stop an item when the pull request text breaks a form rule. A body that the model can fix stops the item at the first refusal. This change sends the problems to the model one time and rebuilds the text. A second refusal still stops the item.
Acceptance criteria
Requirement: Refused text retried once
A roadmap job SHALL send the problems of a refused pull request title or body to the model one time and rebuild the text from the reply.
Scenario: First refusal
- WHEN The form check returns a non-empty problem list for the title or the body that the job built.
- THEN The job makes one more model call that carries every problem, and it rebuilds the text from the reply.
Requirement: Passing rebuilt text is written
The job SHALL write the rebuilt title or body to the pull request when the rebuilt text passes the form check.
Scenario: Rebuilt text passes
- WHEN The form check returns an empty problem list for the rebuilt text.
- THEN The job writes the rebuilt text to the pull request and continues the step with no stop.
Requirement: Second refusal stops the item
The job MUST stop the item with the refused-reply failure class when the rebuilt text fails the form check.
Scenario: Second refusal
- WHEN The form check returns a non-empty problem list for the rebuilt text.
- THEN The job stops the item, records the refused-reply failure class and makes no third model call.
Requirement: No placeholder in a title or body
The job MUST NOT write a ... placeholder into the title or the body of a pull request.
Scenario: Placeholder in the reply
- WHEN The rebuilt title or body holds a placeholder that
is_placeholderrefuses. - THEN The job treats the text as a refusal, and no
...reaches the pull request.
Existing Tool Considered
No check has run. No open, maintained library covers this need: the retry is a bounded loop over the project's own model client and the project's own form rules in src/devops_cli/roadmap/pull_form.py. The change builds the loop in the job layer. The cost is about 45k tokens to build, about 8k tokens each month to keep and fix, and about two days of elapsed time.
Key questions
- Where does the retry step live?: One shared function beside the model client, in
src/devops_cli/roadmap/messages.py. Both jobs call it.pull_form.pykeeps its rule: it reads no file and makes no request. (best practice) [sources: openspec/changes/archive/2026-11-02-3198-pull-request-form-check/design.md:5, openspec/changes/archive/2026-11-02-3198-pull-request-form-check/design.md:39]- Chosen: A shared retry function in the job layer. Both jobs need the same loop, and one copy keeps the two stops equal.
- Rejected: A loop in each job. Two copies drift, and the jobs can stop on different rules.
- Rejected: The retry inside
pull_form.py.pull_form.pymakes no request by design, and a model call breaks that.
- How does the implement job get a model-written body?: The retry adds one bounded model step that writes the body from the change folder and the issue.
build_bodychecks the text of that step. (best practice) [sources: openspec/changes/archive/2026-11-02-3198-pull-request-form-check/design.md:39, src/devops_cli/roadmap/implement_run.py]- Chosen: One bounded model step for the body. The implement job has no free-text step for the body, and one step keeps the cost bounded.
- Rejected: Keep the current builder and skip the retry. The implement job then stops on a body that the model can fix.
- Rejected: Re-run the full implement step. A full step repeats the work of the group and exceeds the step budget.
- How many times does the job send a refused text to the model?: One time. The job builds the title and the body at most twice. (best practice) [sources: openspec/changes/archive/2026-11-02-3198-pull-request-form-check/tasks.md:46]
- Chosen: One retry. The issue asks for one retry, and one retry keeps the cost of a step bounded.
- Rejected: A retry on every refusal. The model calls grow without a limit.
- Rejected: No retry. A fixable body stops the item.
- What does the retry prompt carry?: The refused text and every problem that the form check returns. The model edits the text and keeps its facts. (best practice) [sources: openspec/changes/archive/2026-11-02-3198-pull-request-form-check/proposal.md:9]
- Chosen: The refused text and every problem. The model edits the text and keeps the facts that the job already read.
- Rejected: The problems only. The model rebuilds the text from the sources and can lose a fact.
- Rejected: A shorter text cut by code.
pull_form.pycuts no text, and a cut loses content.
- How does the job treat a placeholder in a rebuilt title or body?:
is_placeholderrefuses it, so the job treats it as a refusal. The retry carries the problem. A second placeholder stops the item. (best practice) [sources: openspec/changes/archive/2026-11-02-3198-pull-request-form-check/tasks.md:9]- Chosen: Refuse the text. The rule is already in the form check, and the retry gives the model one chance to remove the placeholder.
- Rejected: Write the text with the placeholder removed. A silent edit hides a model failure.
- Rejected: Stop the item at the first placeholder. The issue allows one retry.
- Which failure class records the second refusal?: The refused-reply class that the job already uses. The stop record names the class, so a person sees why the item stopped. (best practice) [sources: openspec/changes/archive/2026-11-02-3198-pull-request-form-check/design.md:39]
- Chosen: The existing refused-reply class. One class for one cause keeps the retry rule of the Service simple.
- Rejected: A new class for a second refusal. A second class for the same cause confuses the retry rule.
- How do the tests check the retry with no network?: Unit tests in
tests/roadmap/use a fake model client and the real form check. The tests make no request and open no pull request. (best practice) [sources: tests/roadmap/test_roadmap_pull_form.py]- Chosen: A fake model client. The test checks the number of calls and the stop with no network.
- Rejected: A live model call. The result is not stable, and the test needs a network.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-07: partly.
Tool: pydantic-ai-slim (https://pypi.org/project/pydantic-ai-slim), MIT, last activity 2026-11-04, maintained.
Activity
devops-cli-service commentedon Nov 5, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.Improves robustness of a non-critical path; the safe stop already exists.Prevents unnecessary item stops on a slightly malformed body, but the current stop is safe.Needs a new prompt, a bounded retry step, and tests as stated in the body.Both work on PR text in the stage and implement jobs. #3215 integrates pull_form; the candidate adds a one-time model retry when the form refuses.devops-cli-service commentedon Nov 6, 2026
Status set to Ready at bd65ef6 (see proposed design in issue body).
devops-cli-service commentedon Nov 7, 2026
Alternatives check: partly
Reason: Every search call this run failed with "no provider answered", so no result page could be read; the only tool facts read were the package facts of Pydantic AI, a library the project already depends on (ADR 0005 and ADR 0007 name it). Pydantic AI's agent layer already gives the reusable core of this item - a bounded retry of model output when a validator refuses it, with the problems fed back to the model - but it does not carry the project's own pull-request form rules, the placeholder refusal, the refused-reply failure class or the pull request write, so it covers only a part of the need.
Tool: pydantic-ai-slim (https://pypi.org/project/pydantic-ai-slim)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-07. A person decides what this means for the item. The check changes no label and closes no issue.
fix(roadmap): the cost check reads a time in days or weeks (#4303)
fix(roadmap): name the reason of a failed stage model call (#4339)
19 remaining items
docs(roadmap): Document the one retry of a refused body (#3599)
feat(roadmap): Refuse a body text that ends with a cut mark (#3599)
feat(roadmap): Add the refused_reply failure class (#3599)
feat(roadmap): Add the one-retry rebuild of a refused body (#3599)
feat(roadmap): Rebuild the implement job's refused body once (#3599)
docs(roadmap): Document the one retry of a refused body (#3599)
fix(exceptions): Register RefusedPullReply in roadmap exceptions and …
test(roadmap): Cover pull retry gateway, rewriter, and errors (#3599)
test(roadmap): Use model_fake fixture and eliminate type ignore (#3599)
devops-cli-service commentedon Nov 16, 2026
Released in v0.166.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.166.0
devops-cli-service commentedon Nov 16, 2026
Live since 2026-11-16 18:14 UTC