Repository navigation
Description
What happened
The owner asked on 2026-10-31 for one issue workflow that is simple, clear, discrete, consistent and repeatable for the Service jobs, agentic coders and human developers. The plan and the owner's decisions are in the tracker issue. Decisions taken (the recommended defaults): add the label status/planned (amends ADR 0016); claim an item with labels owner/service, owner/agent and owner/human; a new runner image digest clears a stop once; any actor may claim an item, one at a time, a person's claim beats the Service's, and the Service never takes a claimed item.
Four kinds of pull request become ready by four rules: a stage plan pull request (the Service row of #2882), an implement pull request (the Job's mark_ready), an agent pull request (devops pr ready by hand) and a person's pull request. The owner decided on 2026-10-31 that a draft is marked ready when the work on the change is complete and all checks pass. The model evaluator (#2867) will later add alignment with the issue and the project rules. #2882 left one seam for it.
What should happen
- One function, with one input (the pull request, its kind, its recorded item) and one answer (ready, wait, or refuse with a reason), is the only place that decides. The stage row, the implement Job and
devops pr readycall it. The kinds differ only in what "complete" means: a plan is complete when opened, an implementation when every task group is ticked and the change is archived, an agent's or a person's pull request when its author says so. devops pr check-readinessblocks a pull request of the implement job whose groups are not all ticked (the partial pull request merged as fix(config): config files and their copies keep the mode of the file,... #2801 on 2026-10-30 would be refused).- The evaluator feat(roadmap): Add a draft PR evaluator for issue and rules #2867 plugs into this function. This issue does not build it.
Evidence
- fix(config): config files and their copies keep the mode of the file,... #2801 (a partial job pull request merged), feat(roadmap): the Service marks green stage drafts ready #2882,
implement_pull.mark_ready,devops pr ready.
Acceptance criteria
- A test table covers the four kinds with complete and incomplete cases.
- The implement Job and the stage row use the function.
- A partial implement pull request is refused by
check-readinesswith the group named. -
uv run devops cipasses.
Proposed design
Problem statement
Readiness of a draft pull request is decided in three separate places: the stage_ready row, the implement job, and the devops pr ready command. Each uses its own logic. This caused a partial implement pull request to merge as #2801. One function must be the single place that decides whether a draft pull request is ready, for all four kinds.
Acceptance criteria
Requirement: Single readiness function
The system SHALL provide one function that takes a pull request, its kind, and its recorded item, and returns ready, wait, or refuse with a reason.
Scenario: Function refuses an incomplete implement PR
- WHEN A pull request of kind implement has one unticked task group
- THEN The function returns refuse and the reason names the unticked group
Requirement: Stage row calls the function
The stage_ready row of the Service SHALL call the readiness function instead of its own inline logic.
Scenario: Stage row marks a plan PR ready
- WHEN A stage plan PR is open and all its checks pass
- THEN The stage_ready row calls the function and the function returns ready
Requirement: Implement job calls the function
The implement job SHALL call the readiness function before marking a pull request ready.
Scenario: Implement job refuses a partial PR
- WHEN The implement job has an unticked task group
- THEN The function returns refuse and the job does not mark the PR ready
Requirement: check-readiness command
The command devops pr check-readiness SHALL call the readiness function and report the result, naming the unticked group for a refused implement PR.
Scenario: check-readiness refuses a partial implement PR
- WHEN A user runs devops pr check-readiness on an implement PR with an unticked group
- THEN The command exits non-zero and prints the name of the unticked group
Requirement: Test table covers four kinds
The test suite SHALL include a table-driven test that covers all four kinds with both complete and incomplete cases.
Scenario: Test table has eight rows
- WHEN The test suite runs the readiness function table test
- THEN All eight rows (four kinds times two states) pass
Requirement: CI passes
The command uv run devops ci SHALL pass after the change.
Scenario: CI passes
- WHEN A developer runs uv run devops ci
- THEN All checks pass with exit code 0
Existing Tool Considered
No check has run. No open, maintained tool covers this need. The decision encodes project-specific rules: task group tick state, OpenSpec archive state, and author intent per kind. No library provides a readiness decision for these rules. The cost is building the function: about 200 tokens to write, about 50 tokens per fix cycle, and one development session of elapsed time.
Key questions
- What is the input and output shape of the readiness function?: Input: the pull request object, its kind (stage_plan, implement, agent, person), and its recorded item. Output: a status of ready, wait, or refuse, and a reason string when the status is refuse. (best practice) [sources: openspec/changes/archive/2026-10-31-2865-service-marks-stage-pr-ready/design.md]
- Chosen: One function with a kind parameter. The body states one function is the only place that decides. A kind parameter keeps the decision in one place and makes the test table simple.
- Rejected: Separate functions per kind. Rejected because the body requires one function. Separate functions would split the decision and make the evaluator seam harder to add.
- Where does the function live in the codebase?: In implement_pull.py, alongside the existing mark_ready function, so that both the Service and the CLI import it from one module. (best practice) [sources: openspec/changes/archive/2026-10-31-2865-service-marks-stage-pr-ready/design.md:19]
- Chosen: implement_pull.py alongside mark_ready. The existing mark_ready is already in this module. The Service and the CLI both import from it. No new file is needed.
- Rejected: A new pr_readiness.py module. Rejected because it adds a new file for one function and splits the PR readiness logic across two modules.
- What does complete mean for each kind?: stage_plan: complete when the PR is opened. implement: complete when every task group is ticked and the change is archived. agent: complete when the author says so. person: complete when the author says so. [sources: openspec/changes/archive/2026-10-31-2865-service-marks-stage-pr-ready/proposal.md]
- How does the evaluator feat(roadmap): Add a draft PR evaluator for issue and rules #2867 plug into the function?: The function accepts an optional list of additional check callables. The evaluator adds its alignment check to that list. The function runs all checks and returns refuse if any fails. (best practice) [sources: openspec/changes/archive/2026-10-31-2865-service-marks-stage-pr-ready/design.md]
- Chosen: Optional list of check callables in the function signature. The body says the evaluator plugs into this function. An optional list is a clean seam that adds no coupling. The function stays the single decision point.
- Rejected: The evaluator calls the function and adds its own check after. Rejected because it splits the decision into two places. The body requires one function as the only place that decides.
- What does devops pr check-readiness print for a refused implement PR?: It prints the status refuse and the name of the unticked task group. It exits with a non-zero code. (best practice) [sources: openspec/changes/archive/2026-10-31-2865-service-marks-stage-pr-ready/proposal.md]
- Chosen: Print the unticked group name and exit non-zero. The body says the partial PR would be refused with the group named. A non-zero exit lets a script or hook block the merge.
- Rejected: Print a generic refuse message and exit non-zero. Rejected because the body requires the group to be named so the developer knows what to fix.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Oct 31, 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.It prevents a known incident (partial PR #2801 merged) but is not blocking other work.A single decision point stops partial pull requests from merging and makes readiness consistent for all four kinds.One function with four cases, one CLI command, and a test table; the logic is specified but must be wired into three callers.Both are pieces of the one-issue-workflow; #2908 is the umbrella, the candidate is the readiness-decision function within it.devops-cli-service commentedon Nov 1, 2026
Status set to Ready at 66ed3bf (see proposed design in issue body).
devops-cli-service commentedon Nov 2, 2026
Staged: branch
feat/2916-one-function-decides-when-any-draft, draft pull request #3170. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:
The plan run made 15 model request(s), and used 439653 input tokens and 7272 output tokens. The tool calls, in order:
search_code({"text":"mark_ready"})search_code({"text":"ready_to_mark"})list_files({"directory":"src/devops_cli/roadmap"})read_file({"path":"src/devops_cli/roadmap/implement_pull.py"})read_file({"path":"src/devops_cli/roadmap/stage_ready.py"})search_code({"text":"pr ready"})search_code({"text":"def mark_ready"})search_code({"text":"check-readiness"})search_code({"text":"def pr_ready"})list_files({"directory":"src/devops_cli/commands"})read_file({"path":"src/devops_cli/commands/pr.py"})read_file({"path":"src/devops_cli/roadmap/implement_pull.py","start_line":100,"end_line":200})search_code({"text":"check_readiness"})search_code({"text":"def ready"})search_code({"text":"plan_pr_ready"})read_file({"path":"src/devops_cli/commands/pr.py","start_line":1220,"end_line":1320})read_file({"path":"src/devops_cli/commands/pr.py","start_line":1440,"end_line":1560})read_file({"path":"src/devops_cli/github/pr_plans.py","start_line":180,"end_line":380})list_files({"directory":"src/devops_cli/roadmap"})list_files({"directory":"tests/roadmap"})read_file({"path":"src/devops_cli/roadmap/implement_pull.py"})read_file({"path":"src/devops_cli/roadmap/stage_ready.py"})search_code({"text":"mark_ready"})search_code({"text":"check-readiness"})search_code({"text":"check_readiness"})read_file({"path":"src/devops_cli/commands/pr.py","start_line":1440,"end_line":1560})read_file({"path":"src/devops_cli/github/merge_readiness.py"})search_code({"text":"mark_ready"})search_code({"text":"from devops_cli.roadmap.implement_pull import"})search_code({"text":"mark_ready("})read_file({"path":"src/devops_cli/roadmap/implement_run.py","start_line":1,"end_line":120})docs(openspec): fix the plan of #2916
docs(openspec): plan #2916 One function decides draft readiness (#3170)
devops-cli-service commentedon Nov 3, 2026
Released in v0.49.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.49.0
devops-cli-service commentedon Nov 3, 2026
Live since 2026-11-03 13:34 UTC