Repository navigation
Description
Problem or Motivation
The owner asked on 2026-11-12 that a devops command that runs a CLI tool take the names of the tool and pass its arguments through (#5223, ADR 0026). The issue commands that write do not use the names of gh:
devops gh issue edithas--clear-milestone, which gh names--remove-milestone. It has-s/--state, but gh has no--state: gh usesissue closeandissue reopen. It has no-F/--body-file,--add-assigneeor--remove-assignee.devops gh issue closeneeds--reasonwithcompleted|not-planned, and it takes--comment-file. gh takes-r/--reasonwithcompleted,not plannedorduplicate(defaultcompleted), and-c/--comment <text>.devops gh issue createhas no-F/--body-file(3 failures in the feat(cli): track gh-parity names and usage-error capture #4833 study),-a/--assigneeor-p/--project.devops gh issue reopendoes not exist.- Product text and documents name forms that gh does not have:
src/devops_cli/roadmap/stores/store.py:111tells the user to rundevops gh issue edit {number} --state open, anddocs/roadmap/intake.md:43showsdevops gh issue close <number> --reason not-planned.
The edit command reads the labels and the milestone number over REST and sends one PATCH (github/issues.py). gh does the same work by name.
Proposed Solution & Architectural Design
gh issue create,edit,closeandreopenbecome write entries of the registry of feat(cli): tool commands pass unknown arguments to the tool #5223. Each write runs gh once.issue closeowns-r/--reasonand refuses-r duplicateand--duplicate-ofwith exit 2, because a person closes duplicates (fix(roadmap): intake files and places a candidate that the model judges a duplicate, and names the possible original, instead of dropping or closing it #2223). Click parses each form, so-rduplicateand--reason=duplicateare refused too.- The close comment comes from
-c <text>, as in gh. An agent gives a long comment as-c "$(cat <file>)". This replaces the rule of feat(gh): devops gh issues close records the close reason and a comment #2575 that the comment comes only from a file.docs/SDLC.md:75,docs/roadmap/intake.md:43and the specgh-issues-closechange with it. - The error text of the roadmap store names
devops gh issue reopen <n>(roadmap/stores/store.py:111). - When the issue is already closed, gh writes nothing and exits 0 with a warning on stderr (gh
pkg/cmd/issue/close/close.go). ADR 0026 and the spec record this. A reason change of a closed issue usesdevops gh api -X PATCH repos/<owner>/<repo>/issues/<n> -f state_reason=not_planned. devops sends no read before gh: gh already checks the state, and its warning reaches the caller unchanged. - Premise check: run with
GH_DEBUG=apiand record these facts:gh issue close <pr number>refuses a pull request.- gh posts the
-ccomment before the close. - A close of a closed issue writes nothing.
- When the close mutation gets a rate-limit refusal after the comment, devops does not run gh again, so the comment is posted once (process-stub test).
If one of the first three is false, keep that rule with one REST read before gh, and record it in the proposal.
- The commands stop calling the REST PATCH, the milestone lookup, the label merge and the milestone retry. A function with no other caller goes. The functions that the Service calls keep their paths.
- Add
("issue", "edit"),("issue", "close")and("issue", "reopen")toCONST_GH_GRAPHQL_PORCELAIN_COMMANDS. Each write costs 1 GraphQL point and 5 points of the secondary limit. - No REST fallback for a write. On a rate-limit refusal, the command exits with the code of gh and prints the reset-time line.
- The MCP rows
gh issue create,editandcloseare not read-only. Their allowlists hold no-F/--body-file,--recover,-e/--editor,-w/--webor-p/--project.
Target Subsystem
SDLC, Git & PR Governance (devops gh issue, src/devops_cli/github/issues.py, src/devops_cli/roadmap/stores/store.py).
Existing Tool Considered
The gh commands issue create, edit, close and reopen. They find milestones by title and labels by name, and they post the close comment. Nothing is built.
Acceptance Criteria
devops gh issue edit <n> --remove-milestone --add-label x --dry-runprintsgh issue edit <n> --remove-milestone --add-label xand sends 0 requests.devops gh issue close <n> -r 'not planned' -c 'Superseded by #<m>.'runs gh once (process stub).-r duplicate,-rduplicateand--reason=duplicateexit 2 before a request.devops gh issue reopen <n>runsgh issue reopen <n>.devops gh issue create -t '<title>' -F body.md -l type/bug --dry-runprints the argv.- MCP refuses a call of
gh_issue_createwith-F. - A test: the already-closed message of the roadmap store names
devops gh issue reopen. - A fixture document with
devops gh issue close 1 --reason not-plannedfailsdevops docs check.devops docs checkpasses on the repository.
Dependencies
Merge first: #4848 (commands/gh.py, github/issues.py). Open the pull request after the pull request of #4852 merges, because both change the generated command reference.
Source: #4833
Alternatives check of 2026-11-29: in-use.
The repository already uses this tool.
Tool: cli/cli (https://github.com/cli/cli), MIT, last activity 2026-11-27, maintained.
Reason: The searches found GitHub CLI, whose issue create, edit, close and reopen commands already perform these writes with the requested flags; the remaining work is the devops pass-through wrapper, policy and tests.
Covers:
- Create with body file, assignee, label, milestone and project
- Edit labels, assignees, body file and remove milestone
- Close with reason and comment, and reopen
Lacks:
- No devops duplicate-reason refusal or dry-run preview
- No pass-through registry, MCP allowlists or docs check
- No GraphQL rate-limit classification for writes
Proposed design
Problem statement
The four devops gh issue write commands use flag names and state forms that gh does not have. create lacks -F/--body-file and -a/--assignee, edit takes --state and --clear-milestone, close takes --comment-file and --reason not-planned, and reopen is missing. Product text shows the old forms. The change runs gh once per write with the gh flags. It updates the docs check and the documents, and keeps the devops duplicate refusal. It builds no GitHub client.
Acceptance criteria
Requirement: Create passes gh flags
The devops gh issue create command SHALL pass -t/--title, -F/--body-file, -a/--assignee, -l/--label, -m/--milestone and -p/--project to one gh issue create call.
Scenario: Create dry-run argv
- WHEN A test runs
devops gh issue create -t 'A title' -F body.md -a octocat -l type/bug -m v1 -p Roadmap --dry-runwith the process stub. - THEN The output is
gh issue create -t 'A title' -F body.md -a octocat -l type/bug -m v1 -p Roadmapand the stub records no gh call.
Requirement: Create runs gh once
The devops gh issue create command SHALL run one gh issue create call and MUST send no REST request.
Scenario: Create with a body file
- WHEN A test runs
devops gh issue create -t 'A title' -F body.md -l type/bugwith a process stub that returns an issue URL. - THEN The stub records one
gh issue create -t 'A title' -F body.md -l type/bugcall and the command sends no REST request.
Requirement: Edit passes gh names
The devops gh issue edit command SHALL run gh issue edit <n> once with the given --remove-milestone, --add-label, --add-assignee, --remove-assignee and -F/--body-file values.
Scenario: Edit dry-run argv
- WHEN A test runs
devops gh issue edit 7 --remove-milestone --add-label x --add-assignee octocat --remove-assignee hubot -F body.md --dry-runwith the process stub. - THEN The output is
gh issue edit 7 --remove-milestone --add-label x --add-assignee octocat --remove-assignee hubot -F body.mdand the stub records no gh call and no REST request.
Requirement: Edit rejects removed flags
The devops gh issue edit command MUST NOT accept -s/--state or --clear-milestone.
Scenario: Edit rejects the removed flags
- WHEN A test runs
devops gh issue edit 7 --state open,devops gh issue edit 7 -s openanddevops gh issue edit 7 --clear-milestone. - THEN Each run exits 2 with a usage error and the process stub records no gh call.
Requirement: Close refuses duplicate
The devops gh issue close command MUST refuse -r duplicate, -rduplicate, --reason=duplicate and --duplicate-of <n> with exit 2 before it runs gh.
Scenario: Duplicate reason forms
- WHEN A test runs
devops gh issue close 7with-r duplicate,-rduplicate,--reason=duplicateand--duplicate-of 8. - THEN Each run exits 2 and the process stub records no gh call.
Requirement: Close runs gh with reason and comment
The devops gh issue close command SHALL run one gh call with -r and -c and MUST send no REST request before gh.
Scenario: Close not planned
- WHEN A test runs
devops gh issue close 7 -r 'not planned' -c 'Superseded by #8.'with the process stub. - THEN The stub records one
gh issue close 7 -r 'not planned' -c 'Superseded by #8.'call and no REST request.
Requirement: Close defaults to completed
The devops gh issue close command SHALL pass -r completed when -r/--reason is not given.
Scenario: Close with no reason
- WHEN A test runs
devops gh issue close 7with the process stub. - THEN The stub records one
gh issue close 7 -r completedcall and no REST request.
Requirement: Close rejects the old comment file
The devops gh issue close command MUST NOT accept --comment-file.
Scenario: Close rejects the comment file
- WHEN A test runs
devops gh issue close 7 --comment-file body.md. - THEN The run exits 2 with a usage error and the process stub records no gh call.
Requirement: Reopen runs gh
The devops gh issue reopen command SHALL run one gh issue reopen <n> call and MUST pass -c/--comment when given.
Scenario: Reopen with a comment
- WHEN A test runs
devops gh issue reopen 7 -c 'Reopening.'with the process stub. - THEN The stub records one
gh issue reopen 7 -c 'Reopening.'call and no REST request.
Requirement: Close passes the gh exit code and error
The devops gh issue close command MUST pass the exit code and the standard error of gh through unchanged.
Scenario: Already closed issue
- WHEN A test runs
devops gh issue close 7 -r completedwith a process stub that returns exit 0 and a warning on stderr. - THEN The command exits 0 and prints the warning unchanged, and the stub records one gh call.
Requirement: Rate-limit refusal keeps one comment
When the close mutation gets a rate-limit refusal after the comment, the command MUST NOT run gh again and MUST exit with the code of gh.
Scenario: Close rate limit after comment
- WHEN A process-stub test makes
gh issue closepost the comment and then return a rate-limit refusal. - THEN The command exits with the code of gh and prints the reset-time line, and the stub records one gh call.
Requirement: Close passes the pull-request refusal
The devops gh issue close command MUST pass the gh refusal for a pull request and MUST NOT close a pull request.
Scenario: Close a pull request number
- WHEN A test runs
devops gh issue close 7with a process stub that returns the gh error for a pull request. - THEN The command exits with the code of gh and prints the gh error unchanged, and the stub records one gh call.
Requirement: Store error names reopen
The already-closed message of the roadmap store MUST name devops gh issue reopen <n>.
Scenario: Roadmap store close refusal
- WHEN A test closes an item whose state already changed and reads the error message.
- THEN The message contains
devops gh issue reopen 7and holds no--state openform.
Requirement: Docs check reports an invalid choice
The docs command resolver MUST report a finding when a hand-written devops argv gives a value outside an option's choices.
Scenario: Invalid close reason
- WHEN A test resolves
devops gh issue close 1 --reason not-plannedagainst the changed command tree. - THEN The finding names
--reasonandnot-planned, anddevops gh issue close 1 -r 'not planned'returns no finding.
Requirement: Repository docs pass the check
The repository documents SHALL show the gh close form and SHALL hold no --comment-file or --reason not-planned form.
Scenario: Repository docs check
- WHEN The change updates
docs/SDLC.md,docs/roadmap/intake.mdand.agents/skills/devops-roadmap/SKILL.mdand runsuv run devops docs check. - THEN The command exits 0 with no finding.
Requirement: GraphQL porcelain entries
CONST_GH_GRAPHQL_PORCELAIN_COMMANDS MUST hold ('issue', 'edit'), ('issue', 'close') and ('issue', 'reopen').
Scenario: Porcelain lookup
- WHEN A test imports
CONST_GH_GRAPHQL_PORCELAIN_COMMANDS. - THEN The constant holds each of the three tuples.
Requirement: MCP write rows are narrowed
The three MCP write rows MUST stay not read-only and MUST omit body_file, project, recover, editor and web from their schemas.
Scenario: MCP create with a body file
- WHEN A test calls
gh_issue_createwithbody_file='body.md'. - THEN The call returns an error, the process stub records no gh call, and the three schemas hold none of the omitted parameters.
Requirement: MCP close path removes the comment file
PATH_CONFINEMENTS MUST NOT name gh_issue_close.comment_file.
Scenario: MCP path-confinement audit
- WHEN A test runs the path-confinement audit.
- THEN The audit passes and
PATH_CONFINEMENTSholds nogh_issue_close.comment_fileentry.
Requirement: Write paths send no REST request
The four write commands MUST NOT call the REST PATCH, the milestone lookup, the label merge or the milestone retry.
Scenario: Write paths use no REST session
- WHEN A test runs the four writes with the process stub and a GitHub session that raises on any request. The create stub returns the gh milestone error.
- THEN The create command records one gh call and exits with the gh error. Each other command records one gh call. No command raises a session error.
Existing Tool Considered
The alternatives check of 2026-11-19 in the issue body gives cli/cli (gh), MIT, maintained, the verdict in-use. The block lists what the tool covers and lacks. The change uses gh for the four writes. It adds the devops duplicate refusal, the dry-run, the registry entry and the MCP allowlist that the block lists as lacking. It builds no GitHub client.
Key questions
- Do the four
devops gh issuewrites run gh through the pass-through registry?: Yes. Each write builds the gh argv from its options and runs gh once through a write entry ofREGISTRYinsrc/devops_cli/core/passthrough.py. No REST PATCH, milestone lookup, label merge or milestone retry runs before gh. (best practice) [sources: docs/adr/0037-tool-commands-mirror-and-pass-through-options.md:30, src/devops_cli/core/passthrough.py:117]- Chosen: Run gh once per command through the registry. ADR 0037 says a tool command takes the tool's names and options and passes the arguments through.
- Rejected: Keep the REST PATCH. It uses flag names and state forms that gh does not have.
- Rejected: Build a new GitHub API client. gh covers the four writes and is maintained.
- Which close reason and comment forms does
devops gh issue closeaccept?:-r/--reasontakescompleted(the default) andnot planned.duplicateand--duplicate-of <n>exit 2 before gh.-c/--comment <text>carries the comment.--comment-filegoes. A long comment uses-c "$(cat <file>)". (best practice) [sources: docs/SDLC.md:75, docs/roadmap/intake.md, src/devops_cli/commands/gh.py]- Chosen: Use the gh reason and comment forms and refuse duplicate. It matches gh, and the intake report leaves a possible duplicate to a person.
- Rejected: Accept duplicate. A person decides a duplicate.
- Rejected: Keep --comment-file. gh has no --comment-file, and -c "$(cat <file>)" covers a long comment.
- How does a reason change of a closed issue work?: It uses two writes:
devops gh issue reopen <n>, thendevops gh issue close <n> -r 'not planned'. A PATCH ofstate_reasonalone does not change the reason. The store refuses such a close and names reopen. (best practice) [sources: src/devops_cli/roadmap/stores/store.py:111, openspec/specs/gh-issues-close/spec.md:19, docs/adr/0037-tool-commands-mirror-and-pass-through-options.md:30]- Chosen: Reopen, then close with the reason. It changes the state and the reason. A failed second write leaves the issue open and visible.
- Rejected: PATCH state_reason on the closed issue. GitHub ignores the reason unless the state changes.
- Rejected: PATCH state and state_reason in one request. Sending the same closed state is no state change, so the reason stays ignored.
- Should the write commands count as GraphQL porcelain?: Yes. Add
('issue', 'edit'),('issue', 'close')and('issue', 'reopen')toCONST_GH_GRAPHQL_PORCELAIN_COMMANDS. The rate limiter reads this set to classify the GraphQL point cost. (best practice) [sources: src/devops_cli/config/constants.py:3319, src/devops_cli/github/rate_limiter.py]- Chosen: Add the three tuples. The rate limiter reads this set to classify the GraphQL point cost.
- Rejected: Leave the set unchanged. The writes would use the wrong rate-limit class.
- Should MCP expose the write flags?: Keep the three rows not read-only. Deny
body_file,project,recover,editorandwebin_PATH_PARAM_RESTRICTIONS. Removegh_issue_close.comment_filefromPATH_CONFINEMENTS. (best practice) [sources: src/devops_cli/ai/mcp/generator.py:41, src/devops_cli/ai/mcp/path_confinement.py:23]- Chosen: Narrow the allowlists. An MCP caller can write, but cannot open an editor, a browser, a project or a recovery flow.
- Rejected: Keep the rows read-only. The commands write, and the table already marks them not read-only.
- Rejected: Allow every gh flag. It gives an MCP caller interactive and project access and publishes a file path.
- Which gh behavior does the close path rely on?: The close path relies on gh to refuse a pull request, to post the
-ccomment before the close, and to write nothing and warn on an already-closed issue. The change runs the issue'sGH_DEBUG=apipremise check on a pull-request number, an open issue and a closed issue. It records the request log in the change folder. If a premise fails, the close path adds one REST read before gh and the change records it. (best practice) [sources: docs/adr/0037-tool-commands-mirror-and-pass-through-options.md:30, openspec/specs/gh-issues-close/spec.md:19]- Chosen: Rely on gh and run the premise check. ADR 0037 passes the tool's behavior through, and the premise check shows any false assumption.
- Rejected: Add one REST read before close. It costs a request and duplicates gh unless the premise check shows that a premise is false.
- Rejected: Build a devops check. It is a second copy of a check that gh already makes.
- Does
devops docs checkreport an invalid choice in a document?: No today.CommandReferenceDefectholds unknown command, unknown option, unexpected argument and missing required only. The change adds a finding for an invalid choice, its message and the mapping for a bad parameter. The old--reason not-plannedform then fails the check. (best practice) [sources: src/devops_cli/core/command_resolver.py:56, src/devops_cli/docs/markdown_argv_collector.py]- Chosen: Add a finding for an invalid choice. The issue requires the old
--reason not-plannedform to fail the docs check. The check catches every other invalid choice too. - Rejected: Keep the check as it is. An invalid enum value passes the check, so a document keeps a form that the command refuses at run time.
- Rejected: Make --reason a free string. The check cannot see the value, so the old form still passes.
- Chosen: Add a finding for an invalid choice. The issue requires the old
- Which documents show the removed forms?:
docs/SDLC.md,docs/roadmap/intake.mdand.agents/skills/devops-roadmap/SKILL.mdwith its tracked.claudeand.kilocodecopies. The skill file falls in the hand-written class, which the docs check resolves. [sources: docs/SDLC.md:75, docs/roadmap/intake.md, .agents/skills/devops-roadmap/SKILL.md, src/devops_cli/docs/markdown_argv_collector.py] - Does
devops gh issue createaccept-F/--body-filenow?: No. The command declares--title,-b/--body,-m/--milestone,-l/--labeland-R/--repoonly.create_issue_argsbuilds--titleand--body. A run with--body-filestops withNo such option: --body-file (Possible options: --body). [sources: src/devops_cli/commands/gh.py, src/devops_cli/github/issues.py] - Which dependencies remain?: feat(gh): gh issue view, list and status run gh #4848 only. The change of feat(pr): pr create, edit, close and ready pass gh arguments #4852 is archived, and
pr_editconfinesbody_file. feat(cli): tool commands pass unknown arguments to the tool #5223 is the parent tracker, and an open tracker holds back no item. [sources: openspec/changes/archive/2026-11-25-4852-pr-body-file/proposal.md, src/devops_cli/ai/mcp/path_confinement.py, AGENTS.md]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 12, 2026
Both work on devops gh commands, but #181 adds native PR subcommands while the candidate restructures issue write commands to run gh.devops-cli-service commentedon Nov 17, 2026
Refine cannot set this item to Ready at 90a3d2a while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
src/devops_cli/commands/gh.py,src/devops_cli/github/issues.py,docs/commands/gh.md.devops-cli-service commentedon Nov 19, 2026
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:
Sources:
fix(roadmap): an open tracker holds back no item (#6548)
devops-cli-service commentedon Nov 23, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.
dan-petty commentedon Nov 26, 2026
Evidence of 2026-11-26:
devops gh issue create -R dan-petty/acp --title ... --body-file <file>stopped withNo such option: --body-file (Possible options: --body).gh issue createhas--body-file. The issue was then created withdevops gh api repos/dan-petty/acp/issues -X POST -F body=@<file>.devops-cli-service commentedon Nov 27, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.
devops-cli-service commentedon Nov 28, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
devops-cli-service commentedon Nov 29, 2026
Released in v0.245.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.245.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 05:10 UTC