Repository navigation
Description
Update 2026-11-26 (infra move): The ruleset has a new owner (ADR 0035).
devops repos onboard (row 10) manages the main ruleset of each repository, not OpenTofu stacks. The baseline is in dan-petty/infra. The removal of devops gh branch-protection is still open.
Problem or Motivation
The group manages classic protection only. Its default file .github/branch-protection.yml is missing, so the audit exits 1. No repo uses classic protection.
Order 14 of the plan in #5311. The owner approved the plan on 2026-11-13.
Proposed Solution & Architectural Design
Delete branch_protection.py, its 25 tests, the dry-run rows, the docs and the CLI reference rows. Add no shim.
Target Subsystem
SDLC, Git & PR Governance
Existing Tool Considered
gh ruleset view and check through the pass-through, plus row 10 of devops repos onboard, which manages the main ruleset (ADR 0035).
Cost: Build: about 200k tokens, 0.5 day. Upkeep goes down by about 500 lines and 25 tests.
Acceptance Criteria
- No reference to 'branch-protection' stays in src, the docs or the specs.
- The CI checks pass.
Dependencies
#5323; owner decision 16 in #5311. Part of #5311.
Source: #5311
Alternatives check of 2026-11-26: not-applicable.
Class: refactor, no model call.
Tool: none found.
Proposed design
Problem statement
The devops gh group keeps a classic branch-protection command that manages classic protection only. No managed repository holds its file .github/branch-protection.yml, so its audit exits 1. The command is also a second writer of the protection that the onboard ruleset row owns (ADR 0035). The change removes the group, its module, its 25 tests, its dry-run rows, its documentation and its CLI reference rows. It adds no shim.
Acceptance criteria
Requirement: Remove the branch-protection command group
The devops gh command group SHALL NOT expose a branch-protection command and SHALL add no compatibility shim.
Scenario: Help output omits the branch-protection command
- WHEN A test runs
uv run devops gh --help. - THEN The command exits 0 and its output holds no
branch-protectionentry.
Requirement: Delete the branch-protection module and its tests
The repository MUST NOT hold a source or test file whose name contains branch_protection.
Scenario: No file name in src or tests contains branch_protection
- WHEN A test walks the
srcandteststrees for file names that containbranch_protection. - THEN The walk finds no path.
Requirement: Remove the source references
The src tree SHALL NOT hold the strings branch-protection or branch_protection.
Scenario: Source search returns no match
- WHEN A test searches the
srctree forbranch-protectionandbranch_protection. - THEN The search finds no match.
Requirement: Remove the documentation and spec references
The docs tree and the openspec/specs tree SHALL NOT hold the string branch-protection.
Scenario: Documentation and spec search returns no match
- WHEN A test searches the
docstree and theopenspec/specstree forbranch-protection. - THEN The search finds no match.
Requirement: Keep the generated documentation current
The generated documentation MUST agree with the command tree after the removal.
Scenario: The documentation check passes
- WHEN A check runs
uv run devops ci docs. - THEN The command exits 0 and reports no out-of-date document.
Requirement: Required checks pass
The pull request MUST pass the required Static Analysis and Tests & Coverage checks.
Scenario: Required checks pass on the pull request
- WHEN The pull request runs the required checks.
- THEN
Static AnalysisandTests & Coveragecomplete with conclusion success.
Existing Tool Considered
The alternatives check block of 2026-11-26 in the issue body records not-applicable and Tool: none found, because the class is refactor. No open, maintained tool covers the need: the change deletes code and builds no replacement. The devops gh pass-through already reaches gh ruleset view and gh ruleset check (ADR 0037). devops repos onboard row 10 owns the main ruleset (ADR 0035). The issue body gives the written cost: build about 200k tokens and 0.5 day. Upkeep falls by about 500 lines and 25 tests.
Key questions
- Should the classic branch-protection group be removed outright or kept behind a compatibility shim?: Remove the group outright and add no shim. (best practice) [sources: src/devops_cli/commands/gh.py, src/devops_cli/github/branch_protection.py, AGENTS.md]
- Chosen: Remove the group outright. No managed repository holds
.github/branch-protection.yml, so the group writes nothing and its audit exits 1. - Rejected: Keep a compatibility shim. The shim keeps dead code alive. AGENTS.md rule 2 forbids compensating code.
- Rejected: Keep the classic audit. Its default file
.github/branch-protection.ymlis missing, so the audit exits 1.
- Chosen: Remove the group outright. No managed repository holds
- What replaces the removed classic branch-protection audit?: Use
gh ruleset viewandgh ruleset checkthrough thedevops ghpass-through.devops repos onboardrow 10 owns themainruleset (ADR 0035). (best practice) [sources: docs/repos/onboard.md, docs/CLI_REFERENCE.md]- Chosen: Ruleset view and check through the pass-through. ADR 0035 gives the ruleset to onboard row 10, and the pass-through already reaches
gh(ADR 0037). - Rejected: Build a new classic audit. No repository holds the classic file, so a new audit has no input.
- Rejected: Keep the classic audit. The default file is missing, so the audit exits 1.
- Chosen: Ruleset view and check through the pass-through. ADR 0035 gives the ruleset to onboard row 10, and the pass-through already reaches
- Which modules must lose their use of
branch_protection?:src/devops_cli/commands/gh.py,src/devops_cli/config/constants.pyandsrc/devops_cli/github/merge_readiness.pycall or name the module. The change removes each use with the module. [sources: src/devops_cli/commands/gh.py, src/devops_cli/config/constants.py, src/devops_cli/github/merge_readiness.py] - How does the change keep the documentation and the generated CLI reference correct?: Remove each reference in
docs/in the same pull request. Then regenerate the CLI reference and verify it withuv run devops ci docs. (best practice) [sources: AGENTS.md, docs/CLI_REFERENCE.md, docs/commands/gh.md]- Chosen: Fix the documents and regenerate the reference in the same pull request. AGENTS.md rule 8 requires a document that the change makes wrong to be fixed in the same pull request.
- Rejected: Leave the documents to a later item. The documentation and spec search criterion would then fail.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 13, 2026
Both target the branch-protection feature, but #114 created it and the candidate removes it.devops-cli-service commentedon Nov 16, 2026
Alternatives check: not-applicable
Class: refactor. The check makes no search and no model call for an item of this class.
Tool: none found
Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Refine cannot set this item to Ready at ba041d8 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.
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 in the section Proposed design of the body.
dan-petty commentedon Nov 28, 2026
Audit evidence: custom code against open tools, 2026-11-28, devops-cli at
d0bc3dffa. The audit lists this deletion in rank 26 (dead or duplicate code).src/devops_cli/github/branch_protection.py(502 lines, 25 tests) andcommands/gh.py:1845-1975..github/branch-protection.yml. No repository holds that file (git ls-filesfinds 0).github_repository_ruleset. This deletion stays valid in both cases.#7505 deletes the other dead security modules of rank 26, and leaves this file to this item.
devops-cli-service commentedon Nov 28, 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.